|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.jdbc.JDBCFeatureSource
org.geotools.data.jdbc.JDBCFeatureStore
org.geotools.data.postgis.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 org.geotools.data.jdbc.JDBCFeatureSource |
---|
JDBCFeatureSource.JDBCQueryCapabilities |
Field Summary | |
---|---|
protected static java.lang.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 com.vividsolutions.jts.geom.GeometryFactory |
geometryFactory
Factory for producing geometries (from JTS). |
protected static com.vividsolutions.jts.io.WKTReader |
geometryReader
Well Known Text reader (from JTS). |
protected static com.vividsolutions.jts.io.WKTWriter |
geometryWriter
Well Known Text writer (from JTS). |
protected PostgisSQLBuilder |
sqlBuilder
To create the sql where statement |
protected java.lang.String |
tableName
|
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureStore |
---|
transaction |
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureSource |
---|
queryCapabilities |
Constructor Summary | |
---|---|
PostgisFeatureStore(PostgisDataStore postgisDataStore,
org.opengis.feature.simple.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(java.sql.Connection conn,
java.lang.String geomName,
SQLBuilder sqlBuilder,
org.opengis.filter.Filter filter)
|
protected PostgisDataStore |
getPostgisDataStore()
Performs the setFeautres operation by removing all and then adding the full collection. |
protected int |
getSRID(java.lang.String geomName)
|
java.lang.String |
makeSql(SQLUnpacker unpacker,
Query query)
Deprecated. please use makeSql(query) |
void |
modifyFeatures(org.opengis.feature.type.AttributeDescriptor[] type,
java.lang.Object[] value,
org.opengis.filter.Filter filter)
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. |
void |
modifyFeatures(org.opengis.feature.type.AttributeDescriptor type,
java.lang.Object value,
org.opengis.filter.Filter filter)
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. |
void |
removeFeatures(org.opengis.filter.Filter filter)
Removes the features specified by the passed filter from the PostGIS database. |
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureStore |
---|
addFeatures, addFeatures, assertFids, assertFilter, fids, getInProcessLockingManager, getTransaction, modifyFeatures, setFeatures, setTransaction |
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureSource |
---|
addFeatureListener, close, close, close, count, getConnection, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getJDBCDataStore, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.geotools.data.FeatureSource |
---|
addFeatureListener, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener |
Field Detail |
---|
protected static com.vividsolutions.jts.io.WKTWriter geometryWriter
protected static com.vividsolutions.jts.geom.GeometryFactory geometryFactory
protected static com.vividsolutions.jts.io.WKTReader geometryReader
protected static final java.lang.String CONN_ERROR
protected PostgisSQLBuilder sqlBuilder
protected java.lang.String tableName
protected FIDMapper fidMapper
Constructor Detail |
---|
public PostgisFeatureStore(PostgisDataStore postgisDataStore, org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
java.io.IOException
Method Detail |
---|
protected int getSRID(java.lang.String geomName) throws java.io.IOException
java.io.IOException
public void removeFeatures(org.opengis.filter.Filter filter) throws java.io.IOException
removeFeatures
in interface FeatureStore<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
removeFeatures
in class JDBCFeatureStore
filter
- An OpenGIS filter; specifies which features to remove.
java.io.IOException
- If anything goes wrong or if deleting is not
supported.
DataSourceException
- DOCUMENT ME!public void modifyFeatures(org.opengis.feature.type.AttributeDescriptor[] type, java.lang.Object[] value, org.opengis.filter.Filter filter) throws java.io.IOException
modifyFeatures
in interface FeatureStore<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.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.
java.io.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(org.opengis.feature.type.AttributeDescriptor type, java.lang.Object value, org.opengis.filter.Filter filter) throws java.io.IOException
modifyFeatures
in interface FeatureStore<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.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.
java.io.IOException
- If modificaton is not supported, if the object type
do not match the attribute type.protected PostgisDataStore getPostgisDataStore()
public java.lang.String makeSql(SQLUnpacker unpacker, Query query) throws java.io.IOException
unpacker
- the object to get the encodable filter.query
- the getFeature query - for the tableName, properties and
maxFeatures.
java.io.IOException
- if there are problems encoding the sql.public ReferencedEnvelope getBounds() throws java.io.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<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getBounds
in class JDBCFeatureSource
java.io.IOException
- DOCUMENT ME!public ReferencedEnvelope getBounds(Query query) throws java.io.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<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getBounds
in class JDBCFeatureSource
query
- Query we are requesting the bounds of
java.io.IOException
- DOCUMENT ME!protected ReferencedEnvelope bounds(Query query) throws java.io.IOException
java.io.IOException
protected ReferencedEnvelope getEnvelope(java.sql.Connection conn, java.lang.String geomName, SQLBuilder sqlBuilder, org.opengis.filter.Filter filter) throws java.sql.SQLException, SQLEncoderException, java.io.IOException, com.vividsolutions.jts.io.ParseException
java.sql.SQLException
SQLEncoderException
java.io.IOException
com.vividsolutions.jts.io.ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |