|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectJDBCFeatureSource
JDBCFeatureStore
PostgisFeatureStore
public class PostgisFeatureStore
Implementation of a Postgis specific FeatureStore.
This mostly just rips off code from PostgisDataSource It could definitely use some nice code reuse with PostgisDataStore, as they have a number of similar if not identical methods right now.
Approaching deadlines, however, mean that we're sticking with the code that works, instead of getting all kinds of nice reuse. This'll hopefully change. This bypasses the writers used in JDBCFeatureStore, as I'm just not yet confident in them. We also should do some solid tests to see which is actually faster.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class JDBCFeatureSource |
---|
JDBCFeatureSource.JDBCQueryCapabilities |
Field Summary | |
---|---|
protected static String |
CONN_ERROR
Error message prefix for sql connection errors |
protected FIDMapper |
fidMapper
the name of the column to use for the featureId |
protected static GeometryFactory |
geometryFactory
Factory for producing geometries (from JTS). |
protected static WKTReader |
geometryReader
Well Known Text reader (from JTS). |
protected static WKTWriter |
geometryWriter
Well Known Text writer (from JTS). |
protected PostgisSQLBuilder |
sqlBuilder
To create the sql where statement |
protected String |
tableName
|
Fields inherited from class JDBCFeatureStore |
---|
transaction |
Fields inherited from class JDBCFeatureSource |
---|
queryCapabilities |
Constructor Summary | |
---|---|
PostgisFeatureStore(PostgisDataStore postgisDataStore,
SimpleFeatureType featureType)
|
Method Summary | |
---|---|
protected ReferencedEnvelope |
bounds(Query query)
|
ReferencedEnvelope |
getBounds()
Retrieve Bounds of all Features. |
ReferencedEnvelope |
getBounds(Query query)
Retrieve Bounds of Query results. |
protected ReferencedEnvelope |
getEnvelope(Connection conn,
String geomName,
SQLBuilder sqlBuilder,
Filter filter)
|
protected PostgisDataStore |
getPostgisDataStore()
Performs the setFeautres operation by removing all and then adding the full collection. |
protected int |
getSRID(String geomName)
|
String |
makeSql(SQLUnpacker unpacker,
Query query)
Deprecated. please use makeSql(query) |
void |
modifyFeatures(AttributeDescriptor[] type,
Object[] value,
Filter filter)
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. |
void |
modifyFeatures(AttributeDescriptor type,
Object value,
Filter filter)
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. |
void |
removeFeatures(Filter filter)
Removes the features specified by the passed filter from the PostGIS database. |
Methods inherited from class JDBCFeatureStore |
---|
addFeatures, addFeatures, assertFids, assertFilter, fids, getInProcessLockingManager, getTransaction, modifyFeatures, setFeatures, setTransaction |
Methods inherited from class JDBCFeatureSource |
---|
addFeatureListener, close, close, close, count, getConnection, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getJDBCDataStore, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface FeatureSource |
---|
addFeatureListener, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener |
Field Detail |
---|
protected static WKTWriter geometryWriter
protected static GeometryFactory geometryFactory
protected static WKTReader geometryReader
protected static final String CONN_ERROR
protected PostgisSQLBuilder sqlBuilder
protected String tableName
protected FIDMapper fidMapper
Constructor Detail |
---|
public PostgisFeatureStore(PostgisDataStore postgisDataStore, SimpleFeatureType featureType) throws IOException
IOException
Method Detail |
---|
protected int getSRID(String geomName) throws IOException
IOException
public void removeFeatures(Filter filter) throws IOException
removeFeatures
in interface FeatureStore<SimpleFeatureType,SimpleFeature>
removeFeatures
in class JDBCFeatureStore
filter
- An OpenGIS filter; specifies which features to remove.
IOException
- If anything goes wrong or if deleting is not
supported.
DataSourceException
- DOCUMENT ME!public void modifyFeatures(AttributeDescriptor[] type, Object[] value, Filter filter) throws IOException
modifyFeatures
in interface FeatureStore<SimpleFeatureType,SimpleFeature>
modifyFeatures
in class JDBCFeatureStore
type
- The attributes to modify.value
- The values to put in the attribute types.filter
- An OGC filter to note which attributes to modify.
IOException
- If modificaton is not supported, if the attribute
and object arrays are not eqaul length, or if the object types
do not match the attribute types.
DataSourceException
- DOCUMENT ME!public void modifyFeatures(AttributeDescriptor type, Object value, Filter filter) throws IOException
modifyFeatures
in interface FeatureStore<SimpleFeatureType,SimpleFeature>
modifyFeatures
in class JDBCFeatureStore
type
- The attributes to modify.value
- The values to put in the attribute types.filter
- An OGC filter to note which attributes to modify.
IOException
- If modificaton is not supported, if the object type
do not match the attribute type.protected PostgisDataStore getPostgisDataStore()
public String makeSql(SQLUnpacker unpacker, Query query) throws IOException
unpacker
- the object to get the encodable filter.query
- the getFeature query - for the tableName, properties and
maxFeatures.
IOException
- if there are problems encoding the sql.public ReferencedEnvelope getBounds() throws IOException
JDBCFeatureSource
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>
getBounds
in class JDBCFeatureSource
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>
getBounds
in class JDBCFeatureSource
query
- Query we are requesting the bounds of
IOException
- DOCUMENT ME!protected ReferencedEnvelope bounds(Query query) throws IOException
IOException
protected ReferencedEnvelope getEnvelope(Connection conn, String geomName, SQLBuilder sqlBuilder, Filter filter) throws SQLException, SQLEncoderException, IOException, ParseException
SQLException
SQLEncoderException
IOException
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |