|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractFeatureSource
public abstract class AbstractFeatureSource
This is a starting point for providing your own SimpleFeatureSource implementation.
Subclasses must implement:
You may find a SimpleFeatureSource implementations that is more specific to your needs - such as JDBCFeatureSource.
For an example of this class customized for use please see MemoryDataStore.
Field Summary | |
---|---|
protected Set |
hints
|
protected QueryCapabilities |
queryCapabilities
|
Constructor Summary | |
---|---|
AbstractFeatureSource()
|
|
AbstractFeatureSource(Set hints)
This constructors allows to set the supported hints |
Method Summary | |
---|---|
ReferencedEnvelope |
getBounds()
Retrieve Bounds of all Features. |
ReferencedEnvelope |
getBounds(Query query)
Retrieve Bounds of Query results. |
int |
getCount(Query query)
Retrieve total number of Query results. |
abstract DataStore |
getDataStore()
Overrides to explicitly type narrow the return type to DataStore |
SimpleFeatureCollection |
getFeatures()
Retrieve all Features. |
SimpleFeatureCollection |
getFeatures(Filter filter)
Retrieve all Feature matching the Filter. |
SimpleFeatureCollection |
getFeatures(Query query)
Provides an interface to for the Results of a Query. |
ResourceInfo |
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. |
Set |
getSupportedHints()
By default, no Hints are supported |
Transaction |
getTransaction()
Retrieve the Transaction this SimpleFeatureSource is operating against. |
protected Query |
namedQuery(Query query)
Ensure query modified with typeName. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface FeatureSource |
---|
addFeatureListener, getSchema, removeFeatureListener |
Field Detail |
---|
protected Set hints
protected QueryCapabilities queryCapabilities
Constructor Detail |
---|
public AbstractFeatureSource()
public AbstractFeatureSource(Set hints)
hints
- Method Detail |
---|
public abstract DataStore getDataStore()
DataStore
getDataStore
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
public Name getName()
getSchema().getName()
to honor the simple feature land common
practice of calling the same both the Features produces and their types
getName
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
FeatureSource.getName()
public ResourceInfo getInfo()
FeatureSource
FeatureSource
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>
public QueryCapabilities getQueryCapabilities()
FeatureSource
FeatureSource
natively supports. For example, whether queries can return sorted
results.
getQueryCapabilities
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
public Transaction getTransaction()
For a plain SimpleFeatureSource that cannot modify this will always be Transaction.AUTO_COMMIT.
public SimpleFeatureCollection getFeatures(Query query) throws IOException
Various queries can be made against the results, the most basic being to retrieve Features.
getFeatures
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getFeatures
in interface SimpleFeatureSource
query
-
Query
IOException
- if the underlying data source cannot be accessed.FeatureSource.getFeatures(org.geotools.data.Query)
public SimpleFeatureCollection getFeatures(Filter filter) throws IOException
getFeatures
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getFeatures
in interface SimpleFeatureSource
filter
- Indicates features to retrieve
IOException
- If results could not be obtainedFilter
public SimpleFeatureCollection getFeatures() throws IOException
getFeatures
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getFeatures
in interface SimpleFeatureSource
IOException
- If features could not be obtainedpublic ReferencedEnvelope getBounds() throws IOException
Currently returns null, consider getFeatures().getBounds() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getBounds
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
IOException
- DOCUMENT ME!public ReferencedEnvelope getBounds(Query query) throws IOException
Currently returns null, consider getFeatures( query ).getBounds() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getBounds
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
query
- Query we are requesting the bounds of
IOException
protected Query namedQuery(Query query)
This method will make copy of the provided query, using DefaultQuery, if query.getTypeName is not equal to getSchema().getTypeName().
query
- Original query
public int getCount(Query query) throws IOException
Currently returns -1, consider getFeatures( query ).getCount() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getCount
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
query
- Query we are requesting the count of
IOException
- if there are errors getting the countpublic Set getSupportedHints()
getSupportedHints
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
RenderingHints#Key
objects; may be empty but never null
Hints.FEATURE_DETACHED
,
Hints.JTS_GEOMETRY_FACTORY
,
Hints.JTS_COORDINATE_SEQUENCE_FACTORY
,
Hints.JTS_PRECISION_MODEL
,
Hints.JTS_SRID
,
Hints.GEOMETRY_DISTANCE
,
Hints.FEATURE_2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |