Class ST_Point<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.FunctionWithSRID<R>
org.apache.sis.internal.filter.sqlmm.ST_Point<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>
An expression which creates a point geometry from coordinate values.
In current implementation, the parameters can be:
- WKT|WKB
- WKT|WKB, CoordinateReferenceSystem
- X, Y
- X, Y, CoordinateReferenceSystem
- X, Y, Z
- X, Y, Z, CoordinateReferenceSystem
- Since:
- 1.1
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Geometries<G>
The library to use for creating geometry objects.private final Expression<? super R,
?>[] The expression giving the coordinate values.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.internal.filter.sqlmm.FunctionWithSRID
ABSENT, literalCRS, MAYBE, PRESENT, srid
Fields inherited from class org.apache.sis.internal.filter.sqlmm.SpatialFunction
operation
-
Constructor Summary
ConstructorsConstructorDescriptionST_Point
(Expression<? super R, ?>[] parameters, Geometries<G> library) Creates a new function with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionCreates a point based on the content of the given object.(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.private GeometryWrapper<G>
Parses a WKT or WKB as a point.recreate
(Expression<? super R, ?>[] effective) Creates a new expression of the same type than this expression, but with an optimized geometry.private double
Returns the numerical value evaluated by the expression at the given index.Methods inherited from class org.apache.sis.internal.filter.sqlmm.FunctionWithSRID
expectedType, getTargetCRS
Methods inherited from class org.apache.sis.internal.filter.sqlmm.SpatialFunction
getChildren, getFunctionName, getSyntax, getValueClass, toValueType
Methods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warning
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sis.filter.Optimization.OnExpression
optimize
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
parameters
The expression giving the coordinate values. May include the SRID as last parameter. -
library
The library to use for creating geometry objects.
-
-
Constructor Details
-
ST_Point
ST_Point(Expression<? super R, ?>[] parameters, Geometries<G> library) Creates a new function with the given parameters. It is caller's responsibility to ensure that the given array is non-null, has been cloned and does not contain null elements.- Throws:
IllegalArgumentException
- if the number of arguments is less then two.
-
-
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
this
if unsupported.
-
getGeometryLibrary
Returns a handler for the library of geometric objects used by this expression.- Specified by:
getGeometryLibrary
in 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.
-
value
Returns the numerical value evaluated by the expression at the given index. If the value isnull
, thenDouble.NaN
is returned. If the value is not a number, then anIllegalArgumentException
is thrown.- Parameters:
input
- the object to be evaluated by the expression. Can benull
.index
- the parameter index.name
- parameter name to report in exception message if the value is not a number.- Returns:
- the numerical value, or
Double.NaN
if the value was null. - Throws:
IllegalArgumentException
- if the value is not a number.
-
parse
Parses a WKT or WKB as a point. The result should be a point. While this class could accept to return any kind of geometry, we nevertheless throw an exception if the result is not a point.- Parameters:
value
- the WKB or WKT value to parse. Can benull
.- Returns:
- the parsed point, or
null
if the given value is null. - Throws:
IllegalArgumentException
- if the value is not a string or byte array.Exception
- if parsing failed for another reason.
-
apply
Creates a point based on the content of the given object. This method returnsnull
if all coordinates areDouble.NaN
.- Parameters:
input
- the object to be evaluated by the expression.- Returns:
- point created by the expression, or
null
if all coordinates are NaN.
-