Class GeoPkgFilterToSQL

All Implemented Interfaces:
ExpressionVisitor, FilterVisitor

public class GeoPkgFilterToSQL extends PreparedFilterToSQL
Author:
ian
  • Constructor Details

    • GeoPkgFilterToSQL

      public GeoPkgFilterToSQL(GeoPkgDialect dialect)
      Parameters:
      dialect -
    • GeoPkgFilterToSQL

      public GeoPkgFilterToSQL(Writer out)
      Parameters:
      out -
  • Method Details

    • 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 class FilterToSQL
    • 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 class FilterToSQL
      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 interface ExpressionVisitor
      Overrides:
      visit in class PreparedFilterToSQL
      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 class FilterToSQL