Package org.geotools.geopkg
Class GeoPkgFilterToSQL
- Object
-
- FilterToSQL
-
- PreparedFilterToSQL
-
- GeoPkgFilterToSQL
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
public class GeoPkgFilterToSQL extends PreparedFilterToSQL
- Author:
- ian
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class FilterToSQL
FilterToSQL.FieldEncoder
-
-
Field Summary
-
Fields inherited from class PreparedFilterToSQL
descriptors, 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 GeoPkgFilterToSQL(Writer out)
GeoPkgFilterToSQL(GeoPkgDialect dialect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encode(Filter filter)
Override done to ensure we don't complain if there is a BBOX filter, even if we claim not to support itString
escapeName(String name)
cf. visit(Literal expression,...)Object
visit(Literal expression, Object context)
Export the contents of a Literal Expresionprotected 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
-
Methods inherited from class FilterToSQL
cast, createFilterCapabilities, encode, encodeBinaryComparisonOperator, encodeToString, encodeToString, escapeLiteral, evaluateLiteral, getCapabilities, getDatabaseSchema, getDistanceInNativeUnits, getExpressionType, getFeatureType, getFunctionName, 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, visit, visitBinaryComparisonOperator, visitBinarySpatialOperator, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralGeometry, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMember, writeLiteral
-
-
-
-
Constructor Detail
-
GeoPkgFilterToSQL
public GeoPkgFilterToSQL(GeoPkgDialect dialect)
- Parameters:
dialect
-
-
GeoPkgFilterToSQL
public GeoPkgFilterToSQL(Writer out)
- Parameters:
out
-
-
-
Method Detail
-
escapeName
public String escapeName(String name)
cf. visit(Literal expression,...) When doing temporal queries (like "time BETWEEN t1 AND t2")The encoding of the column name ("time") and the literals must be the same!
There is different handling for Date (DATE) and Timestamp (DATETIME).
For Timestamp (DATETIME), we use the datetime(XYZ, 'utc'):
datetime("Time",'utc') BETWEEN datetime(?,'utc') AND datetime(?,'utc')
For Date (DATE), we do no conversion in the sql lite:
datetime("Date") BETWEEN datetime(?) AND datetime(?)
For non-time columns, this just relegates to the superclass
For GeoPKG, the time column is actually stored as a STRING.
- Overrides:
escapeName
in classFilterToSQL
-
encode
public void encode(Filter filter) throws FilterToSQLException
Override done to ensure we don't complain if there is a BBOX filter, even if we claim not to support it- Overrides:
encode
in classFilterToSQL
- Parameters:
filter
- the Filter to be encoded.- Throws:
FilterToSQLException
- If filter type not supported, or if there were io problems.
-
visit
public Object visit(Literal expression, Object context) throws RuntimeException
Description copied from class:FilterToSQL
Export the contents of a Literal Expresion- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classPreparedFilterToSQL
- Parameters:
expression
- the Literal to export- Throws:
RuntimeException
- for io exception with writer
-
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
-
-