|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.wfs.v1_1_0.WFS_1_1_0_DataStore
public final class WFS_1_1_0_DataStore
A WFS 1.1 DataStore implementation.
Note with the current design, this class is meant to be pulled up as the single WFS DataStore
implementation regardless of the WFS version, since the protocol version specifics is meant to be
handled by the WFSProtocol
implementation provided to this class. For the time being,
while there are no resources to spend on porting the WFS 1.0.0 datastore to the new design, this
keeps here in this 1.1 specific package.
Constructor Summary | |
---|---|
WFS_1_1_0_DataStore(WFSProtocol wfs)
The WFS capabilities document. |
Method Summary | |
---|---|
void |
createSchema(org.opengis.feature.simple.SimpleFeatureType featureType)
Creates storage for a new featureType . |
void |
dispose()
Disposes of this data store and releases any resource that it is using. |
ReferencedEnvelope |
getBounds(Query query)
Only returns the bounds of the query (ie, the bounds of the whole feature type) if the query has no filter set, otherwise the bounds may be too expensive to acquire. |
java.net.URL |
getCapabilitiesURL()
|
int |
getCount(Query query)
If the query is fully supported, makes a GetFeature request with resultType=hits and returns the counts returned by the server, otherwise returns -1
as the result is too expensive to calculate. |
java.net.URL |
getDescribeFeatureTypeURL(java.lang.String typeName)
|
FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureReader(Query query,
Transaction transaction)
Access a FeatureReader providing access to Feature information. |
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureSource(org.opengis.feature.type.Name typeName)
Access to the named resource. |
WFSFeatureSource |
getFeatureSource(java.lang.String typeName)
Access a FeatureSource |
java.lang.String |
getFeatureTypeAbstract(java.lang.String typeName)
|
ReferencedEnvelope |
getFeatureTypeBounds(java.lang.String typeName)
|
org.opengis.referencing.crs.CoordinateReferenceSystem |
getFeatureTypeCRS(java.lang.String typeName)
|
java.util.Set<java.lang.String> |
getFeatureTypeKeywords(java.lang.String typeName)
|
javax.xml.namespace.QName |
getFeatureTypeName(java.lang.String typeName)
|
java.lang.String |
getFeatureTypeTitle(java.lang.String typeName)
|
ReferencedEnvelope |
getFeatureTypeWGS84Bounds(java.lang.String typeName)
|
FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureWriter(java.lang.String typeName,
org.opengis.filter.Filter filter,
Transaction transaction)
Not supported. |
FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureWriter(java.lang.String typeName,
Transaction transaction)
Not supported. |
FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureWriterAppend(java.lang.String typeName,
Transaction transaction)
Not supported. |
WFSServiceInfo |
getInfo()
Overrides DataAccess.getInfo() so it type narrows to a WFSServiceInfo |
LockingManager |
getLockingManager()
Retrieve a per featureID based locking service from this DataStore. |
java.lang.Integer |
getMaxFeatures()
|
protected int |
getMaxFeatures(Query query)
|
java.util.List<org.opengis.feature.type.Name> |
getNames()
Names of the available Resources. |
org.opengis.feature.simple.SimpleFeatureType |
getSchema(org.opengis.feature.type.Name name)
Description of the named resource. |
org.opengis.feature.simple.SimpleFeatureType |
getSchema(java.lang.String prefixedTypeName)
Makes a DescribeFeatureType request for typeName feature type, parses the
server response into a SimpleFeatureType and returns it. |
java.lang.String |
getServiceAbstract()
|
java.util.Set<java.lang.String> |
getServiceKeywords()
|
java.net.URI |
getServiceProviderUri()
|
java.lang.String |
getServiceTitle()
|
java.lang.String |
getServiceVersion()
|
java.lang.String[] |
getTypeNames()
Retrieves a list of of the available FeatureTypes. |
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getView(Query query)
Access a FeatureSource |
boolean |
isPreferPostOverGet()
|
void |
setMaxFeatures(java.lang.Integer maxFeatures)
|
void |
setPreferPostOverGet(java.lang.Boolean booleanValue)
|
java.lang.String |
toString()
|
void |
updateSchema(org.opengis.feature.type.Name typeName,
org.opengis.feature.simple.SimpleFeatureType featureType)
Used to update a schema in place. |
void |
updateSchema(java.lang.String typeName,
org.opengis.feature.simple.SimpleFeatureType featureType)
Used to force namespace and CS info into a persistent change. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WFS_1_1_0_DataStore(WFSProtocol wfs)
capabilities
- Method Detail |
---|
public void setMaxFeatures(java.lang.Integer maxFeatures)
setMaxFeatures
in interface WFSDataStore
WFSDataStore.setMaxFeatures(Integer)
public java.lang.Integer getMaxFeatures()
getMaxFeatures
in interface WFSDataStore
WFSDataStore.getMaxFeatures()
public boolean isPreferPostOverGet()
isPreferPostOverGet
in interface WFSDataStore
WFSDataStore.isPreferPostOverGet()
public void setPreferPostOverGet(java.lang.Boolean booleanValue)
setPreferPostOverGet
in interface WFSDataStore
booleanValue
- Boolean.TRUE to prefer POST over GET, Boolean.FALSE for the opposite, null
for auto (let the implementation decide)WFSDataStore#setPreferPostOverGet(boolean)
public WFSServiceInfo getInfo()
WFSDataStore
DataAccess.getInfo()
so it type narrows to a WFSServiceInfo
getInfo
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getInfo
in interface WFSDataStore
WFSDataStore.getInfo()
public org.opengis.feature.simple.SimpleFeatureType getSchema(java.lang.String prefixedTypeName) throws java.io.IOException
DescribeFeatureType
request for typeName
feature type, parses the
server response into a SimpleFeatureType
and returns it.
Due to a current limitation widely spread through the GeoTools library, the parsed
FeatureType will be adapted to share the same name than the Features produced for it. For
example, if the actual feature type name is Streams_Type
and the features name (i.e.
which is the FeatureType name as stated in the WFS capabilities document) is Stream
,
the returned feature type name will also be Stream
.
getSchema
in interface DataStore
prefixedTypeName
- the type name as stated in the WFS capabilities document
typeName
as stated on the capabilities
document.
java.io.IOException
- If typeName cannot be foundDataStore.getSchema(java.lang.String)
public org.opengis.feature.simple.SimpleFeatureType getSchema(org.opengis.feature.type.Name name) throws java.io.IOException
DataAccess
The FeatureType returned describes the contents being published. For additional metadata please review getInfo( Name ).
getSchema
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
name
- Type name a the resource from getNames()
java.io.IOException
DataAccess.getSchema(Name)
,
getSchema(String)
public java.util.List<org.opengis.feature.type.Name> getNames() throws java.io.IOException
DataAccess
For additional information please see getInfo( Name ) and getSchema( Name ).
getNames
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.io.IOException
DataAccess.getNames()
public java.lang.String[] getTypeNames() throws java.io.IOException
DataStore
This is simply a list of the FeatureType names as aquiring the actual FeatureType schemas may be expensive.
Warning: this list may not be unique - the types may be in separate namespaces.
If you need to worry about such things please consider the use of the Catalog and CatalogEntry interface - many DataStores support this. getTypeNames is really a convience method for a Catalog.iterator() where the name of each entry is returned.
getTypeNames
in interface DataStore
java.io.IOException
DataStore.getTypeNames()
public void dispose()
DataAccess
A DataStore
cannot be used after dispose
has
been called, neither can any data access object it helped create, such
as FeatureReader
, FeatureSource
or FeatureCollection
.
This operation can be called more than once without side effects.
There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.
dispose
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
DataAccess.dispose()
public FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureReader(Query query, Transaction transaction) throws java.io.IOException
DataStore
Filter is used as a low-level indication of constraints. (Implementations may resort to using a FilteredFeatureReader, or provide their own optimizations)
FeatureType provides a template for the returned FeatureReader
Transaction to externalize DataStore state on a per Transaction basis. The most common example is a JDBC datastore saving a Connection for use across several FeatureReader requests. Similarly a Shapefile reader may wish to redirect FeatureReader requests to a alternate filename over the course of a Transaction.
Notes For Implementing DataStore
Subclasses may need to retrieve additional attributes, beyond those
requested by featureType.getAttributeTypes(), in order to correctly
apply the filter
.
These Additional attribtues should be not be returned by
FeatureReader. Subclasses may use ReTypeFeatureReader to aid in
acomplishing this.
Helper classes for implementing a FeatureReader (in order):
Sample use (not optimized):
if (filter == Filter.EXCLUDE) {
return new EmptyFeatureReader(featureType);
}
String typeName = featureType.getTypeName();
FeatureType schema = getSchema( typeName );
FeatureReader reader = new DefaultFeatureReader( getAttributeReaders(), schema );
if (filter != Filter.INCLUDE) {
reader = new FilteringFeatureReader(reader, filter);
}
if (transaction != Transaction.AUTO_COMMIT) {
Map diff = state(transaction).diff(typeName);
reader = new DiffFeatureReader(reader, diff);
}
if (!featureType.equals(reader.getFeatureType())) {
reader = new ReTypeFeatureReader(reader, featureType);
}
return reader
Locking support does not need to be provided for FeatureReaders.
getFeatureReader
in interface DataStore
query
- Requested form of the returned Features and the filter used
to constraints the resultstransaction
- Transaction this query operates against
java.io.IOException
DataStore.getFeatureReader(org.geotools.data.Query,
org.geotools.data.Transaction)
public WFSFeatureSource getFeatureSource(java.lang.String typeName) throws java.io.IOException
DataStore
The resulting FeatureSource
FeatureSource fsource = dataStore.getFeatureSource( "roads" );
FeatureStore fstore = null;
if( fsource instanceof FeatureLocking ){
fstore = (FeatureStore) fs;
}
else {
System.out.println("We do not have write access to roads");
}
getFeatureSource
in interface DataStore
java.io.IOException
DataStore.getFeatureSource(java.lang.String)
public LockingManager getLockingManager()
DataStore
It is common to return an instanceof InProcessLockingManager for DataStores that do not provide native locking.
AbstractFeatureLocking makes use of this service to provide locking
support. You are not limitied by this implementation and may simply
return null
for this value.
getLockingManager
in interface DataStore
null
, no lock support so farDataStore.getLockingManager()
public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getView(Query query) throws java.io.IOException, SchemaException
DataStore
The provided Query does not need to completely cover the existing
schema for Query.getTypeName(). The result will mostly likely only be
a FeatureSource
By using Query we allow support for reprojection, in addition to overriding the CoordinateSystem used by the native FeatureType.
We may wish to limit this method to only support Queries using Filter.EXCLUDE.
Update - GeoServer has an elegatent implementation of this functionality that we could steal. GeoServerFeatureSource, GeoServerFeatureStore and GeoServerFeatureLocking serve as a working prototype.
getView
in interface DataStore
query
- Query.getTypeName() locates FeatureType being viewed
java.io.IOException
- If FeatureSourceSchemaException
- If fetureType is not covered by existing schemaDataStore.getView(org.geotools.data.Query)
,
DefaultView
public FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriter(java.lang.String typeName, org.opengis.filter.Filter filter, Transaction transaction) throws java.io.IOException
getFeatureWriter
in interface DataStore
typeName
- Indicates featureType to be modifiedfilter
- constraints used to limit the modificationtransaction
- Transaction this query operates against
java.lang.UnsupportedOperationException
- always since this operation does not apply to a WFS backend
java.io.IOException
DataStore.getFeatureWriter(java.lang.String,
org.opengis.filter.Filter, org.geotools.data.Transaction)
public FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriter(java.lang.String typeName, Transaction transaction) throws java.io.IOException
getFeatureWriter
in interface DataStore
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
java.lang.UnsupportedOperationException
- always since this operation does not apply to a WFS backend
java.io.IOException
DataStore.getFeatureWriter(java.lang.String,
org.geotools.data.Transaction)
public FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriterAppend(java.lang.String typeName, Transaction transaction) throws java.io.IOException
getFeatureWriterAppend
in interface DataStore
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
java.lang.UnsupportedOperationException
- always since this operation does not apply to a WFS backend
java.io.IOException
DataStore.getFeatureWriterAppend(java.lang.String,
org.geotools.data.Transaction)
public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(org.opengis.feature.type.Name typeName) throws java.io.IOException
DataAccess
The level of access is represented by the instance of the FeatureSource being returned.
Formally:
getFeatureSource
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.io.IOException
DataAccess.getFeatureSource(org.opengis.feature.type.Name)
public void updateSchema(org.opengis.feature.type.Name typeName, org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
DataAccess
This functionality is similar to an "alter table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
updateSchema
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.lang.UnsupportedOperationException
- always since this operation does not apply to a WFS backend
java.io.IOException
- if the operation failedDataAccess.updateSchema(Name, org.opengis.feature.type.FeatureType)
public void updateSchema(java.lang.String typeName, org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
DataStore
The provided featureType should completely cover the existing schema. All attributes should be accounted for and the typeName should match.
Suggestions:
updateSchema
in interface DataStore
java.lang.UnsupportedOperationException
- always since this operation does not apply to a WFS backend
java.io.IOException
DataStore.updateSchema(java.lang.String,
org.opengis.feature.simple.SimpleFeatureType)
public void createSchema(org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
DataAccess
featureType
.
The provided featureType
we be accessable by the typeName
provided by featureType.getTypeName().
createSchema
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
featureType
- FetureType to add to DataStore
java.lang.UnsupportedOperationException
- always since this operation does not apply to a WFS backend
java.io.IOException
- If featureType cannot be createdorg.geotools.data.DataStore#createSchema(org.opengis.feature.simple.SimpleFeatureType)
public javax.xml.namespace.QName getFeatureTypeName(java.lang.String typeName)
getFeatureTypeName
in interface WFSDataStore
WFSDataStore.getFeatureTypeName(java.lang.String)
public java.lang.String getFeatureTypeTitle(java.lang.String typeName)
getFeatureTypeTitle
in interface WFSDataStore
WFSDataStore.getFeatureTypeTitle(String)
public java.lang.String getFeatureTypeAbstract(java.lang.String typeName)
getFeatureTypeAbstract
in interface WFSDataStore
WFSDataStore.getFeatureTypeAbstract(String)
public ReferencedEnvelope getFeatureTypeWGS84Bounds(java.lang.String typeName)
getFeatureTypeWGS84Bounds
in interface WFSDataStore
WFSDataStore.getFeatureTypeWGS84Bounds(String)
public ReferencedEnvelope getFeatureTypeBounds(java.lang.String typeName)
getFeatureTypeBounds
in interface WFSDataStore
WFSDataStore.getFeatureTypeBounds(String)
public org.opengis.referencing.crs.CoordinateReferenceSystem getFeatureTypeCRS(java.lang.String typeName)
getFeatureTypeCRS
in interface WFSDataStore
DefaultEngineeringCRS.GENERIC_2D
is returnedWFSDataStore.getFeatureTypeCRS(String)
public java.util.Set<java.lang.String> getFeatureTypeKeywords(java.lang.String typeName)
getFeatureTypeKeywords
in interface WFSDataStore
WFSDataStore.getFeatureTypeKeywords(String)
public java.net.URL getDescribeFeatureTypeURL(java.lang.String typeName)
getDescribeFeatureTypeURL
in interface WFSDataStore
WFSDataStore.getDescribeFeatureTypeURL(String)
public java.lang.String getServiceAbstract()
getServiceAbstract
in interface WFSDataStore
WFSDataStore.getServiceAbstract()
public java.util.Set<java.lang.String> getServiceKeywords()
getServiceKeywords
in interface WFSDataStore
WFSDataStore.getServiceKeywords()
public java.net.URI getServiceProviderUri()
getServiceProviderUri
in interface WFSDataStore
WFSDataStore.getServiceProviderUri()
public java.net.URL getCapabilitiesURL()
getCapabilitiesURL
in interface WFSDataStore
WFSDataStore.getCapabilitiesURL()
public java.lang.String getServiceTitle()
getServiceTitle
in interface WFSDataStore
WFSDataStore#getserviceTitle()
public java.lang.String getServiceVersion()
getServiceVersion
in interface WFSDataStore
WFSDataStore.getServiceVersion()
public ReferencedEnvelope getBounds(Query query) throws java.io.IOException
query
-
null
if unknown and too expensive for the method to calculate or any errors occur.
java.io.IOException
public int getCount(Query query) throws java.io.IOException
GetFeature
request with resultType=hits
and returns the counts returned by the server, otherwise returns -1
as the result is too expensive to calculate.
query
-
-1
if not supported
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
protected int getMaxFeatures(Query query)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |