Package org.h2gis.geotools
Class H2GISPSFilterToSql
- Object
-
- FilterToSQL
-
- PreparedFilterToSQL
-
- H2GISPSFilterToSql
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
public class H2GISPSFilterToSql extends PreparedFilterToSQL
jdbc-h2gis is an extension to connect H2GIS a spatial library that brings spatial support to the H2 Java database.H2GIS dialect filter based on prepared statements.
- Author:
- Erwan Bocher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class FilterToSQL
FilterToSQL.FieldEncoder
-
-
Field Summary
-
Fields inherited from class PreparedFilterToSQL
descriptors, dialect, dimensions, literalTypes, literalValues, SRIDs
-
Fields inherited from class FilterToSQL
capabilities, currentDimension, currentGeometry, currentSRID, databaseSchema, encodingFunction, escapeBackslash, featureType, fieldEncoder, filterFactory, inEncodingEnabled, inline, IO_ERROR, LOGGER, out, primaryKey, sqlNameEscape
-
-
Constructor Summary
Constructors Constructor Description H2GISPSFilterToSql(H2GISPSDialect dialect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FilterCapabilities
createFilterCapabilities()
Sets the capabilities of this filter.double
getDistanceInNativeUnits(DistanceBufferOperator operator)
Rough evaluation of distance in the units of the current SRID, assuming that the SRID maps to a known EPSG code.protected String
getFunctionName(Function function)
Maps the function to the native database function namevoid
setFunctionEncodingEnabled(boolean functionEncodingEnabled)
Object
visit(Function function, Object extraData)
Writes sql for a function expression.protected Object
visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData)
Handles the more general case of two generic expressions.protected Object
visitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData)
Handles the common case of a PropertyName,Literal geometry binary spatial operator.-
Methods inherited from class PreparedFilterToSQL
convertEnvelopeToPolygon, getDescriptors, getDimensions, getLiteralTypes, getLiteralValues, getSRIDs, isPrepareEnabled, setPrepareEnabled, visit, visit
-
Methods inherited from class FilterToSQL
cast, encode, encode, encodeBinaryComparisonOperator, encodeToString, encodeToString, escapeLiteral, escapeName, evaluateLiteral, getCapabilities, getDatabaseSchema, getExpressionType, getFeatureType, getFunctionReturnType, getParameter, getPrimaryKey, getSqlNameEscape, isBinaryExpression, isEscapeBackslash, isInEncodingEnabled, setCapabilities, setDatabaseSchema, setEscapeBackslash, setFeatureType, setFieldEncoder, setInEncodingEnabled, setInline, setPrimaryKey, setSqlNameEscape, setWriter, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitBinaryComparisonOperator, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralGeometry, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMember, writeLiteral
-
-
-
-
Constructor Detail
-
H2GISPSFilterToSql
public H2GISPSFilterToSql(H2GISPSDialect dialect)
-
-
Method Detail
-
createFilterCapabilities
protected FilterCapabilities createFilterCapabilities()
Description copied from class:FilterToSQL
Sets the capabilities of this filter.- Overrides:
createFilterCapabilities
in classFilterToSQL
- Returns:
- FilterCapabilities for this Filter
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData)
Description copied from class:FilterToSQL
Handles the common case of a PropertyName,Literal geometry binary spatial operator.- Overrides:
visitBinarySpatialOperator
in classFilterToSQL
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData)
Description copied from class:FilterToSQL
Handles the more general case of two generic expressions.The most common case is two PropertyName expressions, which happens during a spatial join.
- Overrides:
visitBinarySpatialOperator
in classFilterToSQL
-
setFunctionEncodingEnabled
public void setFunctionEncodingEnabled(boolean functionEncodingEnabled)
-
getFunctionName
protected String getFunctionName(Function function)
Description copied from class:FilterToSQL
Maps the function to the native database function name- Overrides:
getFunctionName
in classFilterToSQL
-
getDistanceInNativeUnits
public double getDistanceInNativeUnits(DistanceBufferOperator operator)
Description copied from class:FilterToSQL
Rough evaluation of distance in the units of the current SRID, assuming that the SRID maps to a known EPSG code. Will use a rather imprecise transformation for distances over degrees, but better than nothing.- Overrides:
getDistanceInNativeUnits
in classFilterToSQL
-
visit
public Object visit(Function function, Object extraData) throws RuntimeException
Description copied from class:FilterToSQL
Writes sql for a function expression. By default it will write the call by using the same arguments provided to the GeoTools function, subclasses should override on a case by case basis if this behavior is not the desired one.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classFilterToSQL
- Parameters:
function
- a function expression- Throws:
RuntimeException
- If an IO error occurs.- See Also:
FilterToSQL.getFunctionName(Function)
-
-