|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.h2gis.utilities.SFSUtilities
public class SFSUtilities
Generic utilities function to retrieve spatial metadata trough SFS specification. Compatible with H2 and PostGIS.
| Constructor Summary | |
|---|---|
SFSUtilities()
|
|
| Method Summary | |
|---|---|
static List<String> |
getGeometryFields(Connection connection,
String catalog,
String schema,
String table)
Find geometry fields name of a table. |
static List<String> |
getGeometryFields(Connection connection,
TableLocation location)
Find geometry fields name of a table. |
static List<String> |
getGeometryFields(ResultSet resultSet)
Find geometry fields name of a resultSet. |
static int |
getGeometryType(Connection connection,
TableLocation location,
String fieldName)
|
static int |
getGeometryTypeFromGeometry(com.vividsolutions.jts.geom.Geometry geometry)
|
static String |
getGeometryTypeNameFromCode(int geometryTypeCode)
|
static com.vividsolutions.jts.geom.Envelope |
getResultSetEnvelope(ResultSet resultSet)
Compute the full extend of a resultset using the first geometry field. |
static com.vividsolutions.jts.geom.Envelope |
getResultSetEnvelope(ResultSet resultSet,
String fieldName)
Compute the full extend of a resultset using a specified geometry field. |
static com.vividsolutions.jts.geom.Envelope |
getTableEnvelope(Connection connection,
TableLocation location,
String geometryField)
Merge the bounding box of all geometries inside the provided table. |
static boolean |
hasGeometryField(ResultSet resultSet)
Check if the resultset contains a geometry field |
static PreparedStatement |
prepareInformationSchemaStatement(Connection connection,
String catalog,
String schema,
String table,
String informationSchemaTable,
String endQuery)
For table containing catalog, schema and table name, this function create a prepared statement with a filter on this combination. |
static PreparedStatement |
prepareInformationSchemaStatement(Connection connection,
String catalog,
String schema,
String table,
String informationSchemaTable,
String endQuery,
String catalog_field,
String schema_field,
String table_field)
For table containing catalog, schema and table name, this function create a prepared statement with a filter on this combination. |
static Connection |
wrapConnection(Connection connection)
Use this only if DataSource is not available. |
static DataSource |
wrapSpatialDataSource(DataSource dataSource)
In order to be able to use Wrapper.unwrap(Class) and
Wrapper.unwrap(Class) to get SpatialResultSet and
SpatialResultSetMetaData this method wrap the provided dataSource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SFSUtilities()
| Method Detail |
|---|
public static String getGeometryTypeNameFromCode(int geometryTypeCode)
public static int getGeometryTypeFromGeometry(com.vividsolutions.jts.geom.Geometry geometry)
geometry - Geometry instance
public static int getGeometryType(Connection connection,
TableLocation location,
String fieldName)
throws SQLException
connection - Active connectionlocation - Catalog, schema and table namefieldName - Geometry field name or empty (take the first one)
SQLExceptionGeometryTypeCodespublic static DataSource wrapSpatialDataSource(DataSource dataSource)
Wrapper.unwrap(Class) and
Wrapper.unwrap(Class) to get SpatialResultSet and
SpatialResultSetMetaData this method wrap the provided dataSource.
dataSource - H2 or PostGIS DataSource
public static Connection wrapConnection(Connection connection)
Wrapper.unwrap(Class) and
Wrapper.unwrap(Class) to get SpatialResultSet and
SpatialResultSetMetaData this method wrap the provided connection.
connection - H2 or PostGIS Connection
public static com.vividsolutions.jts.geom.Envelope getTableEnvelope(Connection connection,
TableLocation location,
String geometryField)
throws SQLException
connection - Active connection (not closed by this function)location - Location of the tablegeometryField - Geometry field or empty string (take the first geometry field)
SQLException - If the table not exists, empty or does not contain a geometry field.
public static List<String> getGeometryFields(Connection connection,
TableLocation location)
throws SQLException
connection - Active connectionlocation - Table location
SQLException
public static PreparedStatement prepareInformationSchemaStatement(Connection connection,
String catalog,
String schema,
String table,
String informationSchemaTable,
String endQuery,
String catalog_field,
String schema_field,
String table_field)
throws SQLException
connection - Active connectioncatalog - Table catalog, may be emptyschema - Table schema, may be emptytable - Table nameinformationSchemaTable - Information table locationendQuery - Additional where statementcatalog_field - Catalog field nameschema_field - Schema field nametable_field - Table field name
SQLException
public static PreparedStatement prepareInformationSchemaStatement(Connection connection,
String catalog,
String schema,
String table,
String informationSchemaTable,
String endQuery)
throws SQLException
connection - Active connectioncatalog - Table catalog, may be emptyschema - Table schema, may be emptytable - Table nameinformationSchemaTable - Information table locationendQuery - Additional where statement
SQLException
public static List<String> getGeometryFields(Connection connection,
String catalog,
String schema,
String table)
throws SQLException
connection - Active connectioncatalog - Catalog that contain schema (empty for default catalog)schema - Schema that contain table (empty for default schema)table - Table name (case insensitive)
SQLException
public static List<String> getGeometryFields(ResultSet resultSet)
throws SQLException
resultSet -
SQLException
public static boolean hasGeometryField(ResultSet resultSet)
throws SQLException
resultSet -
SQLException
public static com.vividsolutions.jts.geom.Envelope getResultSetEnvelope(ResultSet resultSet)
throws SQLException
resultSet -
SQLException
public static com.vividsolutions.jts.geom.Envelope getResultSetEnvelope(ResultSet resultSet,
String fieldName)
throws SQLException
resultSet - fieldName -
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||