Package org.geotools.data.property
Class PropertyFeatureSource
- Object
-
- ContentFeatureSource
-
- PropertyFeatureSource
-
- All Implemented Interfaces:
FeatureSource<SimpleFeatureType,SimpleFeature>,SimpleFeatureSource
public class PropertyFeatureSource extends ContentFeatureSource
- Author:
- Jody Garnett, Torben Barsballe (Boundless)
-
-
Field Summary
-
Fields inherited from class ContentFeatureSource
entry, hints, lock, query, queryCapabilities, schema, transaction
-
-
Constructor Summary
Constructors Constructor Description PropertyFeatureSource(ContentEntry entry, Query query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddHints(Set<Hints.Key> hints)Subclass hook too add additional hints.protected SimpleFeatureTypebuildFeatureType()Creates the feature type or schema for the feature source.protected QueryCapabilitiesbuildQueryCapabilities()Builds the query capabilities for this feature source.protected ReferencedEnvelopegetBoundsInternal(Query query)Calculates the bounds of a specified query.protected intgetCountInternal(Query query)Calculates the number of features of a specified query.PropertyDataStoregetDataStore()The datastore that this feature source originated from.protected FeatureReader<SimpleFeatureType,SimpleFeature>getReaderInternal(Query query)Subclass method for returning a native reader from the datastore.protected booleanhandleVisitor(Query query, FeatureVisitor visitor)Make handleVisitor package visible allowing PropertyFeatureStore to delegate to this implementation.-
Methods inherited from class ContentFeatureSource
accepts, addFeatureListener, canEvent, canFilter, canFilter, canLimit, canLimit, canLock, canOffset, canOffset, canReproject, canRetype, canRetype, canSort, canSort, canTransact, doLockInternal, doUnlockInternal, getAbsoluteSchema, getBounds, getBounds, getCount, getEntry, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getReader, getReader, getReader, getSchema, getState, getSupportedHints, getTransaction, getView, getView, isView, joinQuery, lockFeatures, lockFeatures, lockFeatures, processLock, removeFeatureListener, resolvePropertyNames, resolvePropertyNames, setFeatureLock, setTransaction, unLockFeatures, unLockFeatures, unLockFeatures
-
-
-
-
Constructor Detail
-
PropertyFeatureSource
public PropertyFeatureSource(ContentEntry entry, Query query)
-
-
Method Detail
-
addHints
protected void addHints(Set<Hints.Key> hints)
Description copied from class:ContentFeatureSourceSubclass hook too add additional hints.By default, the followings are already present:
- Overrides:
addHintsin classContentFeatureSource- Parameters:
hints- The set of hints supported by the feature source.
-
getDataStore
public PropertyDataStore getDataStore()
Description copied from class:ContentFeatureSourceThe datastore that this feature source originated from.Subclasses may wish to extend this method in order to type narrow its return type.
- Specified by:
getDataStorein interfaceFeatureSource<SimpleFeatureType,SimpleFeature>- Overrides:
getDataStorein classContentFeatureSource- Returns:
- the data source providing this
FeatureSource
-
buildQueryCapabilities
protected QueryCapabilities buildQueryCapabilities()
Description copied from class:ContentFeatureSourceBuilds the query capabilities for this feature source. The default implementation returns a newly built QueryCapabilities, subclasses are advised to build their own.- Overrides:
buildQueryCapabilitiesin classContentFeatureSource
-
getBoundsInternal
protected ReferencedEnvelope getBoundsInternal(Query query) throws IOException
Description copied from class:ContentFeatureSourceCalculates the bounds of a specified query. Subclasses must implement this method. If the computation is not fast, subclasses can returnnull.- Specified by:
getBoundsInternalin classContentFeatureSource- Throws:
IOException
-
getCountInternal
protected int getCountInternal(Query query) throws IOException
Description copied from class:ContentFeatureSourceCalculates the number of features of a specified query. Subclasses must implement this method. If the computation is not fast, it's possible to return -1.- Specified by:
getCountInternalin classContentFeatureSource- Throws:
IOException
-
buildFeatureType
protected SimpleFeatureType buildFeatureType() throws IOException
Description copied from class:ContentFeatureSourceCreates the feature type or schema for the feature source.Implementations should use
SimpleFeatureTypeBuilderto build the feature type. Also, the builder should be injected with the feature factory which has been set on the DataStore (seeContentDataStore.getFeatureFactory(). Example:SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); b.setFeatureTypeFactory( getDataStore().getFeatureTypeFactory() ); //build the feature type ...
- Specified by:
buildFeatureTypein classContentFeatureSource- Throws:
IOException
-
getReaderInternal
protected FeatureReader<SimpleFeatureType,SimpleFeature> getReaderInternal(Query query) throws IOException
Description copied from class:ContentFeatureSourceSubclass method for returning a native reader from the datastore.It is important to note that if the native reader intends to handle any of the following natively:
- reprojection
- filtering
- max feature limiting
- sorting
- locking
- transactions
true:ContentFeatureSource.canReproject()- handlesQuery.getCoordinateSystemReproject()internally. Example would be PostGIS using Proj to handle reproejction internallyContentFeatureSource.canFilter(Query)- handlesinternally.- {@link #canLimit(Query)} - handles {@link Query#getMaxFeatures()} and {@link Query#getStartIndex()} internally.
- {@link #canSort(Query)} - handles {@link Query#getSortBy()} natively.
- {@link #canRetype(Query)} - handles {@link Query#getProperties()} natively. Example would be only parsing the properties the user asks for from an XML file
- {@link #canLock()} - handles read-locks natively
- {@link #canTransact()} - handles transactions natively
- Specified by:
getReaderInternalin classContentFeatureSource- Throws:
IOException
-
handleVisitor
protected boolean handleVisitor(Query query, FeatureVisitor visitor) throws IOException
Make handleVisitor package visible allowing PropertyFeatureStore to delegate to this implementation.- Overrides:
handleVisitorin classContentFeatureSource- Parameters:
query- The query being made.visitor- The visitor to- Returns:
- true if the visitor can be handled natively, otherwise false.
- Throws:
IOException
-
-