Class GeometryConstructor<R,G>

Type Parameters:
R - the type of resources (e.g. Feature) used as inputs.
G - the implementation type of geometry objects.
All Implemented Interfaces:
Serializable, Function<R,Object>, Expression<R,Object>, Optimization.OnExpression<R,Object>, FeatureExpression<R,Object>
Direct Known Subclasses:
GeometryParser

class GeometryConstructor<R,G> extends FunctionWithSRID<R>
SQLMM spatial functions taking non-geometry operands and creating a geometry. Geometries can be created from Well-Known Text (WKT), Well-Known Binary (WKB) Geographic Markup Language (GML), or a list of points or coordinates.
Since:
1.1
Version:
1.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • geometry

      final Expression<? super R,?> geometry
      The expression giving the geometry.
    • library

      final Geometries<G> library
      The library to use for creating geometry objects.
  • Constructor Details

    • GeometryConstructor

      GeometryConstructor(SQLMM operation, Expression<? super R,?>[] parameters, Geometries<G> library)
      Creates a new function for the given parameters.
  • Method Details

    • recreate

      public Expression<R,Object> recreate(Expression<? super R,?>[] effective)
      Creates a new expression of the same type than this expression, but with an optimized geometry. The optimization may be a geometry computed immediately if all operator parameters are literals.
      Parameters:
      effective - the expressions to use as a replacement of this expression parameters.
      Returns:
      the new expression, or this if unsupported.
    • getParameters

      public final List<Expression<? super R,?>> getParameters()
      Returns the sub-expressions that will be evaluated to provide the parameters to the function.
      Returns:
      the sub-expressions to be evaluated, or an empty list if none.
    • getGeometryLibrary

      final Geometries<?> getGeometryLibrary()
      Returns a handler for the library of geometric objects used by this expression.
      Specified by:
      getGeometryLibrary in class SpatialFunction<R>
      Returns:
      the geometry library (never null).
      See Also:
    • apply

      public Object apply(R input)
      Creates a geometry from the content of the given object.
      Parameters:
      input - the object to be evaluated by the expression.
      Returns:
      geometry created by the expression, or null if the operation failed..