Class TwoGeometries<R,G>
java.lang.Object
org.apache.sis.internal.filter.Node
org.apache.sis.internal.filter.sqlmm.SpatialFunction<R>
org.apache.sis.internal.filter.sqlmm.TwoGeometries<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:
TwoGeometries.WithArgument
SQLMM spatial functions taking two geometry operands.
- Since:
- 1.1
- Version:
- 1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classSQLMM spatial functions taking a single geometry operand with one argument. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Expression<? super R,GeometryWrapper<G>> The expression giving the geometries.(package private) final Expression<? super R,GeometryWrapper<G>> The expression giving the geometries.private static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.internal.filter.sqlmm.SpatialFunction
operation -
Constructor Summary
ConstructorsConstructorDescriptionTwoGeometries(SQLMM operation, Expression<? super R, ?>[] parameters, Geometries<G> library) Creates a new function for geometries represented by the given parameter. -
Method Summary
Modifier and TypeMethodDescriptionEvaluates the two first expressions as geometry objects, applies the operation and returns the result.(package private) final Geometries<?>Returns a handler for the library of geometric objects used by this expression.List<Expression<? super R,?>> Returns the sub-expressions that will be evaluated to provide the parameters to the function.Expression<? super R,?> optimize(Optimization optimization) If the CRS of the first argument is known in advance and the second argument is a literal, transforms the second geometry to the CRS of the first argument.recreate(Expression<? super R, ?>[] effective) Creates a new expression of the same type than this expression, but with an optimized geometry.Methods inherited from class org.apache.sis.internal.filter.sqlmm.SpatialFunction
expectedType, getChildren, getFunctionName, getSyntax, getValueClass, toValueTypeMethods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warning
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
geometry1
The expression giving the geometries. -
geometry2
The expression giving the geometries.
-
-
Constructor Details
-
TwoGeometries
TwoGeometries(SQLMM operation, Expression<? super R, ?>[] parameters, Geometries<G> library) Creates a new function for geometries represented by the given parameter.
-
-
Method Details
-
recreate
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
thisif unsupported.
-
optimize
If the CRS of the first argument is known in advance and the second argument is a literal, transforms the second geometry to the CRS of the first argument. The transformed geometry is always the second argument because according SQLMM specification, operations shall be executed in the CRS of the first argument.- Parameters:
optimization- the simplifications or optimizations to apply on this expression.- Returns:
- the simplified or optimized expression, or
thisif no optimization has been applied.
-
getGeometryLibrary
Returns a handler for the library of geometric objects used by this expression.- Specified by:
getGeometryLibraryin classSpatialFunction<R>- Returns:
- the geometry library (never
null). - See Also:
-
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.
-
apply
Evaluates the two first expressions as geometry objects, applies the operation and returns the result.- Parameters:
input- the object to be evaluated by the expression. Can benullif this expression allows null values.- Returns:
- value computed by the expression.
-