public class ArcSdeFeatureSource extends Object implements SimpleFeatureSource
| Modifier and Type | Field and Description |
|---|---|
protected ArcSDEDataStore |
dataStore |
protected Transaction |
transaction |
protected FeatureTypeInfo |
typeInfo |
| Constructor and Description |
|---|
ArcSdeFeatureSource(FeatureTypeInfo typeInfo,
ArcSDEDataStore dataStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFeatureListener(FeatureListener listener)
Registers a listening object that will be notified of changes to this
FeatureSource. |
ReferencedEnvelope |
getBounds()
Get the spatial bounds of the feature data.
|
ReferencedEnvelope |
getBounds(Query query)
Get the spatial bounds of the features that would be returned by the given
Query. |
protected ReferencedEnvelope |
getBounds(Query namedQuery,
ISession session) |
int |
getCount(Query query)
Gets the number of the features that would be returned by the given
Query, taking into account any settings for max features and
start index set on the Query. |
protected int |
getCount(Query namedQuery,
ISession session) |
ArcSDEDataStore |
getDataStore()
Returns the data source, as a
DataAccess object, providing this FeatureSource. |
FeatureReader<SimpleFeatureType,SimpleFeature> |
getfeatureReader(SimpleFeatureType targetSchema,
Query query) |
SimpleFeatureCollection |
getFeatures()
Retrieves all features in the form of a
FeatureCollection. |
SimpleFeatureCollection |
getFeatures(Filter filter)
Retrieves features, in the form of a
FeatureCollection, based on an OGC Filter. |
SimpleFeatureCollection |
getFeatures(Query query)
Retrieves features, in the form of a
FeatureCollection, based on a Query. |
ArcSdeResourceInfo |
getInfo()
Returns information describing this
FeatureSource which may include title,
description and spatial parameters. |
Name |
getName()
Returns the same name than the feature type (ie,
getSchema().getName() to honor the
simple feature land common practice of calling the same both the Features produces and their
types |
QueryCapabilities |
getQueryCapabilities()
Enquire what what query capabilities this
FeatureSource natively supports. |
SimpleFeatureType |
getSchema()
Retrieves the schema (feature type) that will apply to features retrieved from this
FeatureSource. |
protected ISession |
getSession()
Returns a session appropriate for the current transaction
This is convenient way to get a connection for
getBounds() and getCount(Query). |
Set<RenderingHints.Key> |
getSupportedHints()
ArcSDE features are always "detached", so we return the FEATURE_DETACHED hint here, as well
as the JTS related ones.
|
ArcSdeVersionHandler |
getVersionHandler() |
void |
removeFeatureListener(FeatureListener listener)
Removes an object from this
FeatureSource's listeners. |
protected Transaction transaction
protected FeatureTypeInfo typeInfo
protected ArcSDEDataStore dataStore
public ArcSdeFeatureSource(FeatureTypeInfo typeInfo,
ArcSDEDataStore dataStore)
public Name getName()
getSchema().getName() to honor the
simple feature land common practice of calling the same both the Features produces and their
typesgetName in interface FeatureSource<SimpleFeatureType,SimpleFeature>FeatureSourceFeatureSource.getName()public ArcSdeResourceInfo getInfo()
FeatureSourceFeatureSource which may include title,
description and spatial parameters. Note that in the returned ResourceInfo object,
the distinction between feature name and schema (feature type) name applies as discussed for
FeatureSource.getName().getInfo in interface FeatureSource<SimpleFeatureType,SimpleFeature>FeatureSource.getInfo()public QueryCapabilities getQueryCapabilities()
FeatureSourceFeatureSource natively supports. For
example, whether queries can return sorted results.getQueryCapabilities in interface FeatureSource<SimpleFeatureType,SimpleFeature>FeatureSourcepublic final void addFeatureListener(FeatureListener listener)
FeatureSourceFeatureSource.addFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>listener - the new listenerFeatureSource.addFeatureListener(FeatureListener)public final void removeFeatureListener(FeatureListener listener)
FeatureSourceFeatureSource's listeners.removeFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>listener - the listener to removeFeatureSource.removeFeatureListener(FeatureListener)public final ReferencedEnvelope getBounds() throws IOException
FeatureSource
getBounds(Query.ALL).
It is possible that this method will return null if the calculation of bounds is judged to
be too costly by the implementing class. In this case, you might call
getFeatures().getBounds() instead.
getBounds in interface FeatureSource<SimpleFeatureType,SimpleFeature>null if the bounds are unknown
or too costly to calculate.IOException - on any errors calculating the boundsFeatureSource.getBounds()public final ReferencedEnvelope getBounds(Query query) throws IOException
FeatureSourceQuery.
It is possible that this method will return null if the calculation of bounds is judged to
be too costly by the implementing class. In this case, you might call
getFeatures(query).getBounds() instead.
getBounds in interface FeatureSource<SimpleFeatureType,SimpleFeature>query - the query to select featuresIOException - on any errors calculating the boundsFeatureSource.getBounds(Query)protected ReferencedEnvelope getBounds(Query namedQuery, ISession session) throws DataSourceException, IOException
namedQuery - session - DataSourceExceptionIOExceptionpublic final int getCount(Query query) throws IOException
FeatureSourceQuery, taking into account any settings for max features and
start index set on the Query.
It is possible that this method will return -1 if the calculation
of number of features is judged to be too costly by the implementing class.
In this case, you might call getFeatures(query).size()
instead.
Example use:
int count = featureSource.getCount();
if( count == -1 ){
count = featureSource.getFeatures( "typeName", count ).size();
}getCount in interface FeatureSource<SimpleFeatureType,SimpleFeature>query - the query to select featuresQuery;
or -1 if this cannot be calculated.IOException - if there are errors getting the countFeatureSource.getCount(Query)protected int getCount(Query namedQuery, ISession session) throws IOException
IOExceptionFeatureSource.getCount(Query)protected final ISession getSession() throws IOException
This is convenient way to get a connection for getBounds() and getCount(Query). ArcSdeFeatureStore overrides to get the connection from the
transaction instead of the pool.
IOExceptionpublic final ArcSDEDataStore getDataStore()
FeatureSourceDataAccess object, providing this FeatureSource.getDataStore in interface FeatureSource<SimpleFeatureType,SimpleFeature>FeatureSourceFeatureSource.getDataStore()public final SimpleFeatureCollection getFeatures(Query query) throws IOException
FeatureSourceFeatureCollection, based on a Query.getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>getFeatures in interface SimpleFeatureSourcequery - DataAccess query for requested information, such as typeName, maxFeatures and
filter.QueryIOException - if the underlying data source cannot be accessed.FeatureSource.getFeatures(Query)public final SimpleFeatureCollection getFeatures(Filter filter) throws IOException
FeatureSourceFeatureCollection, based on an OGC Filter.getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>getFeatures in interface SimpleFeatureSourcefilter - the filter to select features; must not be null (use Filter.INCLUDE instead)FilterIOException - if the underlying data source cannot be accessed.FeatureSource.getFeatures(Filter)public final SimpleFeatureCollection getFeatures() throws IOException
FeatureSourceFeatureCollection.
The following statements are equivalent:
featureSource.getFeatures();
featureSource.getFeatures(Filter.INCLUDE);
featureSource.getFeatures(Query.ALL);
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>getFeatures in interface SimpleFeatureSourceQueryIOException - if the underlying data source cannot be accessed.FeatureSource.getFeatures()public final SimpleFeatureType getSchema()
FeatureSourceFeatureSource.
For a homogeneous data source such as a shapefile or a database table, this schema be that of all features. For a heterogeneous data source, e.g. a GML document, the schema returned is the lowest common denominator across all features.
getSchema in interface FeatureSource<SimpleFeatureType,SimpleFeature>FeatureSourceFeatureSource.getSchema();public final Set<RenderingHints.Key> getSupportedHints()
The JTS related hints supported are:
GeometryFactory is provided through the JTS_GEOMETRY_FACTORY hint, that very factory is used and takes precedence over all the other
ones.getSupportedHints in interface FeatureSource<SimpleFeatureType,SimpleFeature>RenderingHints#Key objects; may be empty but never nullFeatureSource.getSupportedHints(),
Hints.FEATURE_DETACHED,
Hints.JTS_GEOMETRY_FACTORY,
Hints.JTS_COORDINATE_SEQUENCE_FACTORY,
Hints.JTS_PRECISION_MODEL,
Hints.JTS_SRIDpublic ArcSdeVersionHandler getVersionHandler() throws IOException
IOExceptionpublic FeatureReader<SimpleFeatureType,SimpleFeature> getfeatureReader(SimpleFeatureType targetSchema, Query query) throws IOException
IOExceptionCopyright © 1996–2019 Geotools. All rights reserved.