|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree.io.datastore.Datastore
org.deegree.io.datastore.sql.AbstractSQLDatastore
org.deegree.io.datastore.sql.postgis.PostGISDatastore
public class PostGISDatastore
Datastore
implementation for PostGIS/PostgreSQL databases.
Field Summary | |
---|---|
protected static ILogger |
LOG
|
Fields inherited from class org.deegree.io.datastore.sql.AbstractSQLDatastore |
---|
pool |
Constructor Summary | |
---|---|
PostGISDatastore()
|
Method Summary | |
---|---|
protected Connection |
acquireConnection()
Returns the database connection requested for. |
SQLFunctionCall |
buildSRSTransformCall(MappedGeometryPropertyType geoProperty,
String targetSRS)
Returns an SQLFunctionCall that refers to the given MappingGeometryField in
the specified target SRS using a database specific SQL function. |
String |
buildSRSTransformCall(String geomIdentifier,
int nativeSRSCode)
Builds an SQL fragment that converts the given geometry to the specified SRS. |
protected boolean |
canTransformTo(String targetSRS)
Returns whether the datastore is capable of performing a native coordinate transformation (using an SQL function call for example) into the given SRS. |
Geometry |
convertDBToDeegreeGeometry(Object value,
CoordinateSystem targetCS,
Connection conn)
Converts a PostGIS specific geometry Object from the ResultSet
to a deegree Geometry . |
org.postgis.PGgeometry |
convertDeegreeToDBGeometry(Geometry geometry,
int targetSRS,
Connection conn)
Converts a deegree Geometry to a PostGIS specific geometry object. |
int |
getNativeSRSCode(String srsName)
Returns the database specific code for the given SRS name. |
Object |
getSequenceNextVal(Connection conn,
String sequence)
Returns the next value of the given SQL sequence. |
PostGISWhereBuilder |
getWhereBuilder(MappedFeatureType[] rootFts,
String[] aliases,
Filter filter,
SortProperty[] sortProperties,
TableAliasGenerator aliasGenerator,
VirtualContentProvider vcProvider)
Returns a specific WhereBuilder implementation for PostGIS. |
protected Query |
transformQuery(Query query)
Transforms the incoming Query so that the CoordinateSystem of all spatial
arguments (BBOX, etc.) in the Filter match the SRS of the targeted
MappingGeometryField s. |
protected FeatureCollection |
transformResult(FeatureCollection fc,
String targetSRS)
Transforms the FeatureCollection so that the geometries of all contained geometry
properties use the requested SRS. |
Methods inherited from class org.deegree.io.datastore.sql.AbstractSQLDatastore |
---|
acquireTransaction, close, configure, convertFromDBType, createTransaction, determineFidsToLock, getAnnotationParser, getMaxValue, performQuery, performQuery, performQuery, prepareStatement, releaseConnection, releaseTransaction |
Methods inherited from class org.deegree.io.datastore.Datastore |
---|
bindSchema, getConfiguration, getFeatureType, getSchemas |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final ILogger LOG
Constructor Detail |
---|
public PostGISDatastore()
Method Detail |
---|
public PostGISWhereBuilder getWhereBuilder(MappedFeatureType[] rootFts, String[] aliases, Filter filter, SortProperty[] sortProperties, TableAliasGenerator aliasGenerator, VirtualContentProvider vcProvider) throws DatastoreException
WhereBuilder
implementation for PostGIS.
getWhereBuilder
in class AbstractSQLDatastore
rootFts
- involved (requested) feature typesaliases
- aliases for the feature types, may be nullfilter
- filter that restricts the matched featuressortProperties
- sort criteria for the result, may be null or emptyaliasGenerator
- used to generate unique table aliasesvcProvider
-
WhereBuilder
implementation for PostGIS
DatastoreException
public Geometry convertDBToDeegreeGeometry(Object value, CoordinateSystem targetCS, Connection conn) throws SQLException
Object
from the ResultSet
to a deegree Geometry
.
convertDBToDeegreeGeometry
in class AbstractSQLDatastore
value
- targetCS
- conn
-
SQLException
public org.postgis.PGgeometry convertDeegreeToDBGeometry(Geometry geometry, int targetSRS, Connection conn) throws DatastoreException
Geometry
to a PostGIS specific geometry object.
convertDeegreeToDBGeometry
in class AbstractSQLDatastore
geometry
- targetSRS
- conn
-
DatastoreException
protected Connection acquireConnection() throws DatastoreException
AbstractSQLDatastore
acquireConnection
in class AbstractSQLDatastore
DatastoreException
public Object getSequenceNextVal(Connection conn, String sequence) throws DatastoreException
getSequenceNextVal
in class AbstractSQLDatastore
conn
- JDBC connection to be usedsequence
- name of the SQL sequence
DatastoreException
- if the value could not be retrievedprotected Query transformQuery(Query query)
Query
so that the CoordinateSystem
of all spatial
arguments (BBOX, etc.) in the Filter
match the SRS of the targeted
MappingGeometryField
s.
NOTE: If this transformation can be performed by the backend (e.g. by Oracle Spatial), this
method should be overwritten to return the original input Query
.
transformQuery
in class Datastore
query
- query to be transformed
protected FeatureCollection transformResult(FeatureCollection fc, String targetSRS)
FeatureCollection
so that the geometries of all contained geometry
properties use the requested SRS.
transformResult
in class Datastore
fc
- feature collection to be transformedtargetSRS
- requested SRS
protected boolean canTransformTo(String targetSRS)
canTransformTo
in class Datastore
targetSRS
- target spatial reference system (usually "EPSG:XYZ")
public SQLFunctionCall buildSRSTransformCall(MappedGeometryPropertyType geoProperty, String targetSRS) throws DatastoreException
SQLFunctionCall
that refers to the given MappingGeometryField
in
the specified target SRS using a database specific SQL function.
buildSRSTransformCall
in class AbstractSQLDatastore
geoProperty
- geometry propertytargetSRS
- target spatial reference system (usually "EPSG:XYZ")
SQLFunctionCall
that refers to the geometry in the specified srs
DatastoreException
public String buildSRSTransformCall(String geomIdentifier, int nativeSRSCode) throws DatastoreException
AbstractSQLDatastore
buildSRSTransformCall
in class AbstractSQLDatastore
DatastoreException
public int getNativeSRSCode(String srsName)
AbstractSQLDatastore
getNativeSRSCode
in class AbstractSQLDatastore
srsName
- spatial reference system name (usually "EPSG:XYZ")
|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net