Package org.geotools.data.postgis
Class PostgisFilterToSQL
Object
FilterToSQL
PostgisFilterToSQL
- All Implemented Interfaces:
ExpressionVisitor,FilterVisitor
-
Nested Class Summary
Nested classes/interfaces inherited from class FilterToSQL
FilterToSQL.FieldEncoder -
Field Summary
FieldsFields inherited from class FilterToSQL
capabilities, currentDimension, currentGeometry, currentSRID, databaseSchema, encodingFunction, escapeBackslash, featureType, fieldEncoder, filterFactory, inEncodingEnabled, inline, IO_ERROR, LOGGER, out, primaryKey, sqlNameEscape -
Constructor Summary
ConstructorsConstructorDescriptionPostgisFilterToSQL(PostGISDialect dialect) PostgisFilterToSQL(PostGISDialect dialect, Version pgVersion) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGives the opportunity to subclasses to force the property to the desired type.protected FilterCapabilitiesSets the capabilities of this filter.doubleRough evaluation of distance in the units of the current SRID, assuming that the SRID maps to a known EPSG code.protected StringgetFunctionName(Function function) Maps the function to the native database function namebooleanisEncodeBBOXFilterAsEnvelope(boolean encodeBBOXFilterAsEnvelope) booleanprotected voidprocessLikeLeftOperand(Object extraData, boolean matchCase, Expression att, Class attributeType) voidsetEncodeBBOXFilterAsEnvelope(boolean encodeBBOXFilterAsEnvelope) voidsetFunctionEncodingEnabled(boolean functionEncodingEnabled) voidsetLooseBBOXEnabled(boolean looseBBOXEnabled) Writes sql for a function expression.Export the contents of a Literal Expresionvisit(PropertyIsBetween filter, Object extraData) Writes the SQL for the PropertyIsBetween Filter.visit(PropertyIsEqualTo filter, Object extraData) Write the SQL for this kind of filterprotected voidvisitBinaryComparisonOperator(BinaryComparisonOperator filter, Object extraData) Overrides base behavior to handler arraysprotected ObjectvisitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData) Handles the more general case of two generic expressions.protected ObjectvisitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData) Handles the common case of a PropertyName,Literal geometry binary spatial operator.protected voidvisitLiteralGeometry(Literal expression) Subclasses must implement this method in order to encode geometry filters according to the specific database implementationMethods inherited from class FilterToSQL
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, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMember, writeLiteral
-
Field Details
-
pgDialect
-
-
Constructor Details
-
PostgisFilterToSQL
-
PostgisFilterToSQL
-
-
Method Details
-
isLooseBBOXEnabled
public boolean isLooseBBOXEnabled() -
setLooseBBOXEnabled
public void setLooseBBOXEnabled(boolean looseBBOXEnabled) -
isEncodeBBOXFilterAsEnvelope
public boolean isEncodeBBOXFilterAsEnvelope(boolean encodeBBOXFilterAsEnvelope) -
setEncodeBBOXFilterAsEnvelope
public void setEncodeBBOXFilterAsEnvelope(boolean encodeBBOXFilterAsEnvelope) -
visitLiteralGeometry
Description copied from class:FilterToSQLSubclasses must implement this method in order to encode geometry filters according to the specific database implementation- Overrides:
visitLiteralGeometryin classFilterToSQL- Throws:
IOException
-
createFilterCapabilities
Description copied from class:FilterToSQLSets the capabilities of this filter.- Overrides:
createFilterCapabilitiesin classFilterToSQL- Returns:
- FilterCapabilities for this Filter
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData) Description copied from class:FilterToSQLHandles the common case of a PropertyName,Literal geometry binary spatial operator.- Overrides:
visitBinarySpatialOperatorin classFilterToSQL
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData) Description copied from class:FilterToSQLHandles the more general case of two generic expressions.The most common case is two PropertyName expressions, which happens during a spatial join.
- Overrides:
visitBinarySpatialOperatorin classFilterToSQL
-
visit
Description copied from class:FilterToSQLWrites 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:
visitin interfaceExpressionVisitor- Overrides:
visitin classFilterToSQL- Parameters:
function- a function expression- Throws:
RuntimeException- If an IO error occurs.- See Also:
-
visit
Description copied from class:FilterToSQLExport the contents of a Literal Expresion- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classFilterToSQL- Parameters:
literal- the Literal to export
-
getFunctionName
Description copied from class:FilterToSQLMaps the function to the native database function name- Overrides:
getFunctionNamein classFilterToSQL
-
cast
Description copied from class:FilterToSQLGives the opportunity to subclasses to force the property to the desired type. By default it simply writes out the property as-is (the property must be already escaped).- Overrides:
castin classFilterToSQL- Throws:
IOException
-
setFunctionEncodingEnabled
public void setFunctionEncodingEnabled(boolean functionEncodingEnabled) -
getDistanceInNativeUnits
Description copied from class:FilterToSQLRough 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:
getDistanceInNativeUnitsin classFilterToSQL
-
visitBinaryComparisonOperator
protected void visitBinaryComparisonOperator(BinaryComparisonOperator filter, Object extraData) throws RuntimeException Overrides base behavior to handler arrays- Overrides:
visitBinaryComparisonOperatorin classFilterToSQL- Parameters:
filter- the comparison to be turned into SQL.- Throws:
RuntimeException- for io exception with writer
-
visit
Writes the SQL for the PropertyIsBetween Filter.- Specified by:
visitin interfaceFilterVisitor- Overrides:
visitin classFilterToSQL- Parameters:
filter- the Filter to be visited.- Throws:
RuntimeException- for io exception with writer
-
visit
Description copied from class:FilterToSQLWrite the SQL for this kind of filter- Specified by:
visitin interfaceFilterVisitor- Overrides:
visitin classFilterToSQL- Parameters:
filter- the filter to visitextraData- extra data (unused by this method)
-
processLikeLeftOperand
protected void processLikeLeftOperand(Object extraData, boolean matchCase, Expression att, Class attributeType) throws IOException - Overrides:
processLikeLeftOperandin classFilterToSQL- Throws:
IOException
-