Package org.h2gis.utilities
Class GeometryTableUtilities
- java.lang.Object
-
- org.h2gis.utilities.GeometryTableUtilities
-
public class GeometryTableUtilities extends Object
Utilities to get geometry metadata from a table that contains at least one geometry column- Author:
- Erwan Bocher, CNRS (2020)
-
-
Constructor Summary
Constructors Constructor Description GeometryTableUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanalterSRID(Connection connection, String table, String geometryColumnName, int srid)Change the SRID of the tablestatic booleanalterSRID(Connection connection, TableLocation tableLocation, String geometryColumnName, int srid)Change the SRID of the tablestatic String[]getAuthorityAndSRID(Connection connection, int srid)Return an array of two string if the input SRID exists in the spatial ref table.static String[]getAuthorityAndSRID(Connection connection, String table, String geometryColumnName)Return an array of two string that correspond to the authority name and its SRID code.If the SRID does not exist return the array {null, null}static String[]getAuthorityAndSRID(Connection connection, TableLocation table, String geometryColumnName)Return an array of two string that correspond to the authority name and its SRID code.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, String table)Merge the bounding box of all geometries inside the provided table.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, String table, String geometryColumn)Merge the bounding box of all geometries inside the provided table.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, String subQuery, String[] geometryColumns)Merge the bounding box of all geometries inside a provided subquery, geometry columns Note that the geometry column can be an expression.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, String subQuery, String[] geometryColumns, String filter)Merge the bounding box of all geometries inside a provided subquery, geometry columns and filter condition Note that the geometry column can be an expression.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, TableLocation location)Merge the bounding box of all geometries inside the provided table.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, TableLocation location, String geometryColumn)Merge the bounding box of all geometries inside the provided table.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, TableLocation location, String... geometryColumns)Merge the bounding box of all geometries inside the provided table and geometry columns Note that the geometry column can be an expression.static org.locationtech.jts.geom.GeometrygetEnvelope(Connection connection, TableLocation location, String[] geometryColumns, String filter)Merge the bounding box of all geometries inside the provided table, geometry columns and filter condition Note that the geometry column can be an expression.static org.locationtech.jts.geom.GeometrygetEnvelope(ResultSet resultSet)Compute the full extend of a ResultSet using the first geometry field.static org.locationtech.jts.geom.GeometrygetEnvelope(ResultSet resultSet, String geometryColumnName)Compute the full extend of a ResultSet using a specified geometry column.static org.locationtech.jts.geom.GeometrygetEstimatedExtent(Connection connection, String tableName)Compute the 'estimated' extent of the given spatial table.static org.locationtech.jts.geom.GeometrygetEstimatedExtent(Connection connection, String tableName, String geometryColumnName)Compute the 'estimated' extent of the given spatial table.static org.locationtech.jts.geom.GeometrygetEstimatedExtent(Connection connection, TableLocation tableLocation)Compute the 'estimated' extent of the given spatial table.static org.locationtech.jts.geom.GeometrygetEstimatedExtent(Connection connection, TableLocation tableLocation, String geometryColumnName)Compute the 'estimated' extent of the given spatial table.static Tuple<String,GeometryMetaData>getFirstColumnMetaData(Connection connection, String geometryTable)Read the geometry metadata of the first geometry columnstatic Tuple<String,GeometryMetaData>getFirstColumnMetaData(Connection connection, TableLocation geometryTable)Read the geometry metadata of the first geometry columnstatic Tuple<String,GeometryMetaData>getFirstColumnMetaData(ResultSet resultSet)The geometry metadata of a resulset is getting from the first row Because a resulset can mixed geometry types and SRID we are not able to return all geometry metadatas Use this method only to instantiate a GeometryMetaData objectstatic Tuple<String,Integer>getFirstGeometryColumnNameAndIndex(Connection connection, String tableName)Find the first geometry column name of a table with its indexstatic Tuple<String,Integer>getFirstGeometryColumnNameAndIndex(Connection connection, TableLocation tableLocation)Find the first geometry column name of a table with its indexstatic Tuple<String,Integer>getFirstGeometryColumnNameAndIndex(ResultSet resultSet)Find the first geometry column name and its index of a resultSet.static Tuple<String,Integer>getFirstGeometryColumnNameAndIndex(ResultSetMetaData metadata)Find the first geometry column name of a table with its indexstatic List<String>getGeometryColumnNames(Connection connection, String tableName)Find geometry column namesstatic List<String>getGeometryColumnNames(Connection connection, TableLocation tableLocation)Find geometry column namesstatic List<String>getGeometryColumnNames(ResultSetMetaData metadata)Find geometry column names from a resulsetstatic LinkedHashMap<String,Integer>getGeometryColumnNamesAndIndexes(Connection connection, String tableName)static LinkedHashMap<String,Integer>getGeometryColumnNamesAndIndexes(Connection connection, TableLocation tableLocation)Find geometry column names and indexes of a tablestatic LinkedHashMap<String,Integer>getGeometryColumnNamesAndIndexes(ResultSetMetaData metadata)Find geometry column names and indexes from a resulsetstatic ResultSetgetGeometryColumnsView(Connection connection, String catalog, String schema, String table)static ResultSetgetGeometryColumnsView(Connection connection, String catalog, String schema, String table, String geometryField)Return a resulset of the geometry column view properties fromstatic LinkedHashMap<String,GeometryMetaData>getMetaData(Connection connection, String geometryTable)Read all geometry metadata from a tablestatic GeometryMetaDatagetMetaData(Connection connection, String geometryTable, String geometryColumnName)Read the geometry metadata from a column namestatic LinkedHashMap<String,GeometryMetaData>getMetaData(Connection connection, TableLocation geometryTable)Read all geometry metadata from a tablestatic GeometryMetaDatagetMetaData(Connection connection, TableLocation geometryTable, String geometryColumnName)Read the geometry metadata from a column namestatic LinkedHashMap<String,GeometryMetaData>getMetaData(ResultSet resultSet)Read the geometry metadata for a resulsetstatic intgetSRID(Connection connection, String tableName)Return the SRID of the first geometry column of the input tablestatic intgetSRID(Connection connection, String tableName, String geometryColumnName)Return the SRID of the first geometry column of the input tablestatic intgetSRID(Connection connection, TableLocation tableLocation)Return the SRID of the first geometry column of the input tablestatic intgetSRID(Connection connection, TableLocation tableLocation, String geometryColumnName)Return the SRID of the first geometry column of the input tablestatic booleanhasGeometryColumn(Connection connection, String tableLocation)Check if the table contains a geometry columnstatic booleanhasGeometryColumn(Connection connection, TableLocation tableLocation)Check if the table contains a geometry columnstatic booleanhasGeometryColumn(ResultSet resultSet)Check if the ResultSet contains a geometry columnstatic booleanisSpatialIndexed(Connection connection, TableLocation tableLocation, String geometryColumnName)Check if the geometry column has a spatial indexstatic PreparedStatementprepareInformationSchemaStatement(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 PreparedStatementprepareInformationSchemaStatement(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.
-
-
-
Method Detail
-
getFirstColumnMetaData
public static Tuple<String,GeometryMetaData> getFirstColumnMetaData(Connection connection, String geometryTable) throws SQLException
Read the geometry metadata of the first geometry column- Parameters:
connection-geometryTable-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
getFirstColumnMetaData
public static Tuple<String,GeometryMetaData> getFirstColumnMetaData(Connection connection, TableLocation geometryTable) throws SQLException
Read the geometry metadata of the first geometry column- Parameters:
connection-geometryTable-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
getFirstColumnMetaData
public static Tuple<String,GeometryMetaData> getFirstColumnMetaData(ResultSet resultSet) throws SQLException
The geometry metadata of a resulset is getting from the first row Because a resulset can mixed geometry types and SRID we are not able to return all geometry metadatas Use this method only to instantiate a GeometryMetaData object- Parameters:
resultSet-- Returns:
- Partial geometry metaData
- Throws:
SQLException
-
getMetaData
public static LinkedHashMap<String,GeometryMetaData> getMetaData(ResultSet resultSet) throws SQLException
Read the geometry metadata for a resulset- Parameters:
resultSet-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
getMetaData
public static LinkedHashMap<String,GeometryMetaData> getMetaData(Connection connection, String geometryTable) throws SQLException
Read all geometry metadata from a table- Parameters:
connection-geometryTable-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
getMetaData
public static LinkedHashMap<String,GeometryMetaData> getMetaData(Connection connection, TableLocation geometryTable) throws SQLException
Read all geometry metadata from a table- Parameters:
connection-geometryTable-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
getMetaData
public static GeometryMetaData getMetaData(Connection connection, String geometryTable, String geometryColumnName) throws SQLException
Read the geometry metadata from a column name- Parameters:
connection-geometryTable-geometryColumnName-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
getMetaData
public static GeometryMetaData getMetaData(Connection connection, TableLocation geometryTable, String geometryColumnName) throws SQLException
Read the geometry metadata from a column name- Parameters:
connection-geometryTable-geometryColumnName-- Returns:
- Geometry MetaData
- Throws:
SQLException
-
prepareInformationSchemaStatement
public static PreparedStatement prepareInformationSchemaStatement(Connection connection, String catalog, String schema, String table, String informationSchemaTable, String endQuery) throws SQLException
For table containing catalog, schema and table name, this function create a prepared statement with a filter on this combination. Use "f_table_catalog","f_table_schema","f_table_name" as field names.- Parameters:
connection- Active connectioncatalog- Table catalog, may be emptyschema- Table schema, may be emptytable- Table nameinformationSchemaTable- Information table locationendQuery- Additional where statement- Returns:
- Prepared statement
- Throws:
SQLException
-
prepareInformationSchemaStatement
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
For table containing catalog, schema and table name, this function create a prepared statement with a filter on this combination.- Parameters:
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- Returns:
- Prepared statement
- Throws:
SQLException
-
getFirstGeometryColumnNameAndIndex
public static Tuple<String,Integer> getFirstGeometryColumnNameAndIndex(ResultSet resultSet) throws SQLException
Find the first geometry column name and its index of a resultSet.- Parameters:
resultSet- ResultSet to analyse- Returns:
- The name and index of first geometry field
- Throws:
SQLException
-
hasGeometryColumn
public static boolean hasGeometryColumn(ResultSet resultSet) throws SQLException
Check if the ResultSet contains a geometry column- Parameters:
resultSet- ResultSet to analyse- Returns:
- True if the ResultSet contains one geometry field
- Throws:
SQLException
-
hasGeometryColumn
public static boolean hasGeometryColumn(Connection connection, String tableLocation) throws SQLException
Check if the table contains a geometry column- Parameters:
connection-tableLocation-- Returns:
- True if the ResultSet contains one geometry field
- Throws:
SQLException
-
hasGeometryColumn
public static boolean hasGeometryColumn(Connection connection, TableLocation tableLocation) throws SQLException
Check if the table contains a geometry column- Parameters:
connection-tableLocation-- Returns:
- True if the ResultSet contains one geometry field
- Throws:
SQLException
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(ResultSet resultSet) throws SQLException
Compute the full extend of a ResultSet using the first geometry field. If the ResultSet does not contain any geometry field throw an exception- Parameters:
resultSet- ResultSet to analyse- Returns:
- A geometry that represents the full extend of the first geometry column in the ResultSet
- Throws:
SQLException
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(ResultSet resultSet, String geometryColumnName) throws SQLException
Compute the full extend of a ResultSet using a specified geometry column. If the ResultSet does not contain this geometry field throw an exception If the geometries don't have the same SRID throw an exception- Parameters:
resultSet- ResultSet to analysegeometryColumnName- Field to analyse- Returns:
- The full extend of the geometry column name in the ResultSet
- Throws:
SQLException
-
getEstimatedExtent
public static org.locationtech.jts.geom.Geometry getEstimatedExtent(Connection connection, String tableName) throws SQLException
Compute the 'estimated' extent of the given spatial table. Use the first geometry field In case of POSTGIS : the estimated is taken from the geometry column's statistics. In case of H2GIS : the estimated is taken from the spatial index of the geometry column. If the estimated extend is null the extent is computed.- Parameters:
connection-tableName-- Returns:
- Throws:
SQLException
-
getEstimatedExtent
public static org.locationtech.jts.geom.Geometry getEstimatedExtent(Connection connection, TableLocation tableLocation) throws SQLException
Compute the 'estimated' extent of the given spatial table. Use the first geometry field In case of POSTGIS : the estimated is taken from the geometry column's statistics. In case of H2GIS : the estimated is taken from the spatial index of the geometry column. If the estimated extend is null the extent is computed.- Parameters:
connection-tableLocation-- Returns:
- an estimated extend of the table as geometry
- Throws:
SQLException
-
getEstimatedExtent
public static org.locationtech.jts.geom.Geometry getEstimatedExtent(Connection connection, String tableName, String geometryColumnName) throws SQLException
Compute the 'estimated' extent of the given spatial table. In case of POSTGIS : the estimated is taken from the geometry column's statistics. In case of H2GIS : the estimated is taken from the spatial index of the geometry column. If the estimated extend is null the extent is computed.- Parameters:
connection-tableName-geometryColumnName-- Returns:
- an estimated extend of the table as geometry
- Throws:
SQLException
-
getEstimatedExtent
public static org.locationtech.jts.geom.Geometry getEstimatedExtent(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException
Compute the 'estimated' extent of the given spatial table. In case of POSTGIS : the estimated is taken from the geometry column's statistics. In case of H2GIS : the estimated is taken from the spatial index of the geometry column. If the estimated extend is null the extent is computed.- Parameters:
connection-tableLocation-geometryColumnName-- Returns:
- an estimated extend of the table as geometry
- Throws:
SQLException
-
getSRID
public static int getSRID(Connection connection, String tableName, String geometryColumnName) throws SQLException
Return the SRID of the first geometry column of the input table- Parameters:
connection- Active connectiontableName- Table namegeometryColumnName- The geometryf field column- Returns:
- The SRID of the first geometry column
- Throws:
SQLException
-
getSRID
public static int getSRID(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException
Return the SRID of the first geometry column of the input table- Parameters:
connection- Active connectiontableLocation- Table namegeometryColumnName- The geometryf field column- Returns:
- The SRID of the first geometry column
- Throws:
SQLException
-
getSRID
public static int getSRID(Connection connection, String tableName) throws SQLException
Return the SRID of the first geometry column of the input table- Parameters:
connection- Active connectiontableName- Table name- Returns:
- The SRID of the first geometry column
- Throws:
SQLException
-
getSRID
public static int getSRID(Connection connection, TableLocation tableLocation) throws SQLException
Return the SRID of the first geometry column of the input table- Parameters:
connection- Active connectiontableLocation- Table name- Returns:
- The SRID of the first geometry column
- Throws:
SQLException
-
getGeometryColumnNamesAndIndexes
public static LinkedHashMap<String,Integer> getGeometryColumnNamesAndIndexes(Connection connection, String tableName) throws SQLException
- Throws:
SQLException
-
getGeometryColumnNamesAndIndexes
public static LinkedHashMap<String,Integer> getGeometryColumnNamesAndIndexes(Connection connection, TableLocation tableLocation) throws SQLException
Find geometry column names and indexes of a table- Parameters:
connection- Active connectiontableLocation- Table location- Returns:
- A list of Geometry column names and indexes
- Throws:
SQLException
-
getGeometryColumnNamesAndIndexes
public static LinkedHashMap<String,Integer> getGeometryColumnNamesAndIndexes(ResultSetMetaData metadata) throws SQLException
Find geometry column names and indexes from a resulset- Parameters:
metadata- metadata of a resulset- Returns:
- A list of Geometry column names and indexes
- Throws:
SQLException
-
getGeometryColumnNames
public static List<String> getGeometryColumnNames(Connection connection, String tableName) throws SQLException
Find geometry column names- Parameters:
connection- Active connectiontableName- Table location- Returns:
- A list of Geometry column names and indexes
- Throws:
SQLException
-
getGeometryColumnNames
public static List<String> getGeometryColumnNames(Connection connection, TableLocation tableLocation) throws SQLException
Find geometry column names- Parameters:
connection- Active connectiontableLocation- Table location- Returns:
- A list of Geometry column names and indexes
- Throws:
SQLException
-
getGeometryColumnNames
public static List<String> getGeometryColumnNames(ResultSetMetaData metadata) throws SQLException
Find geometry column names from a resulset- Parameters:
metadata- metadata of a resulset- Returns:
- A list of Geometry column names
- Throws:
SQLException
-
getFirstGeometryColumnNameAndIndex
public static Tuple<String,Integer> getFirstGeometryColumnNameAndIndex(Connection connection, String tableName) throws SQLException
Find the first geometry column name of a table with its index- Parameters:
connection- Active connectiontableName- Table location- Returns:
- The first geometry column name and its index
- Throws:
SQLException
-
getFirstGeometryColumnNameAndIndex
public static Tuple<String,Integer> getFirstGeometryColumnNameAndIndex(Connection connection, TableLocation tableLocation) throws SQLException
Find the first geometry column name of a table with its index- Parameters:
connection- Active connectiontableLocation- Table location- Returns:
- The first geometry column name and its index
- Throws:
SQLException
-
getFirstGeometryColumnNameAndIndex
public static Tuple<String,Integer> getFirstGeometryColumnNameAndIndex(ResultSetMetaData metadata) throws SQLException
Find the first geometry column name of a table with its index- Parameters:
metadata- metadata of a resulset- Returns:
- The first geometry column name and its index
- Throws:
SQLException
-
getGeometryColumnsView
public static ResultSet getGeometryColumnsView(Connection connection, String catalog, String schema, String table) throws SQLException
- Parameters:
connection- Active connectioncatalog-schema-table-- Returns:
- Throws:
SQLException
-
getGeometryColumnsView
public static ResultSet getGeometryColumnsView(Connection connection, String catalog, String schema, String table, String geometryField) throws SQLException
Return a resulset of the geometry column view properties from- Parameters:
connection-catalog-schema-table-geometryField-- Returns:
- Throws:
SQLException
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, String table, String geometryColumn) throws SQLException
Merge the bounding box of all geometries inside the provided table.- Parameters:
connection- Active connection (not closed by this function)table- Location of the tablegeometryColumn- Geometry field or empty string (take the first geometry field)- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or geometry field empty.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, TableLocation location, String geometryColumn) throws SQLException
Merge the bounding box of all geometries inside the provided table.- Parameters:
connection- Active connection (not closed by this function)location- Location of the tablegeometryColumn- Geometry field or empty string (take the first geometry field)- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or geometry field empty.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, TableLocation location, String... geometryColumns) throws SQLException
Merge the bounding box of all geometries inside the provided table and geometry columns Note that the geometry column can be an expression. Supported syntaxesthe_geom -> Column name st_buffer(the_geom, 20) -> Geometry function- Parameters:
connection- Active connection (not closed by this function)location- Location of the tablegeometryColumns- List of geometry columns or geometry functions- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or geometry field empty.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, TableLocation location, String[] geometryColumns, String filter) throws SQLException
Merge the bounding box of all geometries inside the provided table, geometry columns and filter condition Note that the geometry column can be an expression. Supported syntaxesthe_geom -> Column name st_buffer(the_geom, 20) -> Geometry function- Parameters:
connection- Active connection (not closed by this function)location- Location of the tablegeometryColumns- List of geometry columns or geometry functionsfilter- filter condition after the from- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or geometry field empty.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, String subQuery, String[] geometryColumns) throws SQLException
Merge the bounding box of all geometries inside a provided subquery, geometry columns Note that the geometry column can be an expression. Supported syntaxesthe_geom -> Column name st_buffer(the_geom, 20) -> Geometry function- Parameters:
connection- Active connection (not closed by this function)subQuery- a subquery to filter the datageometryColumns- List of geometry columns or geometry functions- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or geometry field empty.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, String subQuery, String[] geometryColumns, String filter) throws SQLException
Merge the bounding box of all geometries inside a provided subquery, geometry columns and filter condition Note that the geometry column can be an expression. Supported syntaxesthe_geom -> Column name st_buffer(the_geom, 20) -> Geometry function- Parameters:
connection- Active connection (not closed by this function)subQuery- a subquery to filter the datageometryColumns- List of geometry columns or geometry functionsfilter- filter condition after the from- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or geometry field empty.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, String table) throws SQLException
Merge the bounding box of all geometries inside the provided table. Use the first geometry column- Parameters:
connection- Active connection (not closed by this function)table- table name- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or does not contain a geometry field.
-
getEnvelope
public static org.locationtech.jts.geom.Geometry getEnvelope(Connection connection, TableLocation location) throws SQLException
Merge the bounding box of all geometries inside the provided table. Use the first geometry column- Parameters:
connection- Active connection (not closed by this function)location- Location of the table- Returns:
- Envelope of the table as Geometry
- Throws:
SQLException- If the table not exists, empty or does not contain a geometry field.
-
getAuthorityAndSRID
public static String[] getAuthorityAndSRID(Connection connection, int srid) throws SQLException
Return an array of two string if the input SRID exists in the spatial ref table. The array contains the authority name and its SRID code. If the SRID does not exist return null- Parameters:
connection- Active connectionsrid-- Returns:
- Array of two string that correspond to the authority name and its SRID code
- Throws:
SQLException
-
getAuthorityAndSRID
public static String[] getAuthorityAndSRID(Connection connection, String table, String geometryColumnName) throws SQLException
Return an array of two string that correspond to the authority name and its SRID code.If the SRID does not exist return the array {null, null}- Parameters:
connection- Active connectiontable- Table namegeometryColumnName- Field to analyse- Returns:
- Array of two string that correspond to the authority name and its SRID code
- Throws:
SQLException
-
getAuthorityAndSRID
public static String[] getAuthorityAndSRID(Connection connection, TableLocation table, String geometryColumnName) throws SQLException
Return an array of two string that correspond to the authority name and its SRID code. If the SRID does not exist return the array {null, null}- Parameters:
connection- Active connectiontable- Table namegeometryColumnName- Field to analyse- Returns:
- Array of two string that correspond to the authority name and its SRID code
- Throws:
SQLException
-
alterSRID
public static boolean alterSRID(Connection connection, String table, String geometryColumnName, int srid) throws SQLException
Change the SRID of the table- Parameters:
connection- Active connectiontable- Table namegeometryColumnName- geometry column namesrid- to force- Returns:
- true if query is well executed
- Throws:
SQLException
-
alterSRID
public static boolean alterSRID(Connection connection, TableLocation tableLocation, String geometryColumnName, int srid) throws SQLException
Change the SRID of the table- Parameters:
connection- Active connectiontableLocation- Table namegeometryColumnName- geometry column namesrid- to force- Returns:
- true if query is well executed
- Throws:
SQLException
-
isSpatialIndexed
public static boolean isSpatialIndexed(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException
Check if the geometry column has a spatial index- Parameters:
connection- Active connectiontableLocation- Table namegeometryColumnName- geometry column name- Returns:
- true if query is well executed
- Throws:
SQLException
-
-