org.h2gis.h2spatial.internal.function.spatial.properties
Class ColumnSRID
java.lang.Object
org.h2gis.h2spatialapi.AbstractFunction
org.h2gis.h2spatial.internal.function.spatial.properties.ColumnSRID
- All Implemented Interfaces:
- Function, ScalarFunction
public class ColumnSRID
- extends AbstractFunction
- implements ScalarFunction
Get the column SRID from constraints and data.
- Author:
- Nicolas Fortin
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColumnSRID
public ColumnSRID()
getJavaStaticMethod
public String getJavaStaticMethod()
- Specified by:
getJavaStaticMethod in interface ScalarFunction
getSRIDFromConstraint
public static int getSRIDFromConstraint(String constraint,
String columnName)
- Parameters:
constraint - Constraint expression ex:"ST_SRID(the_geom) = 27572"
- Returns:
- The SRID or 0 if no constraint are found or constraint on other column
fetchConstraint
public static String fetchConstraint(Connection connection,
String catalogName,
String schemaName,
String tableName)
throws SQLException
- Read table constraints from database metadata.
- Parameters:
connection - Active connectioncatalogName - Catalog name or empty stringschemaName - Schema name or empty stringtableName - table name
- Returns:
- Found table constraints
- Throws:
SQLException
getSRID
public static int getSRID(Connection connection,
String catalogName,
String schemaName,
String tableName,
String columnName,
String constraint)
- Parameters:
connection - Active connectiontableName - Target table namecolumnName - Spatial field nameconstraint - Column constraint
- Returns:
- The column SRID from constraints and data.
Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.