|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.jdbc.JDBCFeatureSource org.geotools.data.jdbc.JDBCFeatureStore org.geotools.data.postgis.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.
Field Summary | |
protected static java.lang.String |
CONN_ERROR
Error message prefix for sql connection errors |
protected SQLEncoderPostgis |
encoder
|
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 |
Constructor Summary | |
PostgisFeatureStore(PostgisDataStore postgisDataStore,
FeatureType featureType)
|
Method Summary | |
protected com.vividsolutions.jts.geom.Envelope |
bounds(Query query)
|
com.vividsolutions.jts.geom.Envelope |
getBounds()
Gets the bounding box of this datasource. |
com.vividsolutions.jts.geom.Envelope |
getBounds(Query query)
Retrieve Bounds of Query results. |
protected com.vividsolutions.jts.geom.Envelope |
getEnvelope(java.sql.Connection conn,
java.lang.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(java.lang.String geomName)
|
java.lang.String |
makeSql(SQLUnpacker unpacker,
Query query)
Creates a SQL statement for the PostGIS database. |
void |
modifyFeatures(AttributeType[] type,
java.lang.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(AttributeType type,
java.lang.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 org.geotools.data.jdbc.JDBCFeatureStore |
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, getJDBCDataStore, getSchema, 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, getSchema, 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 SQLEncoderPostgis encoder
protected java.lang.String tableName
protected FIDMapper fidMapper
Constructor Detail |
public PostgisFeatureStore(PostgisDataStore postgisDataStore, FeatureType featureType) throws java.io.IOException
Method Detail |
protected int getSRID(java.lang.String geomName) throws java.io.IOException
java.io.IOException
public void removeFeatures(Filter filter) throws java.io.IOException
removeFeatures
in interface FeatureStore
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!FeatureStore.modifyFeatures(org.geotools.feature.AttributeType,
java.lang.Object, org.geotools.filter.Filter)
public void modifyFeatures(AttributeType[] type, java.lang.Object[] value, Filter filter) throws java.io.IOException
modifyFeatures
in interface FeatureStore
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!FeatureStore.modifyFeatures(org.geotools.feature.AttributeType,
java.lang.Object, org.geotools.filter.Filter)
public void modifyFeatures(AttributeType type, java.lang.Object value, Filter filter) throws java.io.IOException
modifyFeatures
in interface FeatureStore
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.FeatureStore.modifyFeatures(org.geotools.feature.AttributeType,
java.lang.Object, org.geotools.filter.Filter)
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.
DataSourceException
- DOCUMENT ME!public com.vividsolutions.jts.geom.Envelope getBounds() throws java.io.IOException
FeatureSource
With getBounds(Query) this becomes a convenience method for getBounds(Query.ALL), that is the bounds for all features contained here.
If getBounds() returns null
due to expense consider using
getFeatures().getBounds()
as a an alternative.
getBounds
in interface FeatureSource
getBounds
in class JDBCFeatureSource
java.io.IOException
- DOCUMENT ME!public com.vividsolutions.jts.geom.Envelope 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
getBounds
in class JDBCFeatureSource
query
- Query we are requesting the bounds of
java.io.IOException
- DOCUMENT ME!protected com.vividsolutions.jts.geom.Envelope bounds(Query query) throws java.io.IOException
java.io.IOException
protected com.vividsolutions.jts.geom.Envelope getEnvelope(java.sql.Connection conn, java.lang.String geomName, SQLBuilder sqlBuilder, 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 |