Package org.apache.sis.internal.feature
Class SpatialOperationContext
java.lang.Object
org.apache.sis.internal.feature.SpatialOperationContext
- All Implemented Interfaces:
Serializable
Context (such as desired CRS) in which a spatial operator will be executed.
Instances of this class are immutable and thread-safe.
The serialization form is not a committed API and may change in any future version.
- Since:
- 1.1
- Version:
- 1.3
- Author:
- Martin Desruisseaux (Geomatys)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSpatialOperationContext(org.opengis.metadata.extent.GeographicBoundingBox areaOfInterest, GeometryWrapper<?> literal, javax.measure.Unit<?> systemUnit, int skipIndex) Creates a new context. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanThe value to return when a test cannot be applied.static booleanThe value to return when a test cannot be applied.<G> GeometryWrapper<G> transform(GeometryWrapper<G> geometry) Transforms the specified geometry to the computation CRS.
-
Constructor Details
-
SpatialOperationContext
public SpatialOperationContext(org.opengis.metadata.extent.GeographicBoundingBox areaOfInterest, GeometryWrapper<?> literal, javax.measure.Unit<?> systemUnit, int skipIndex) throws org.opengis.util.FactoryException, org.opengis.referencing.operation.TransformException, javax.measure.IncommensurableException Creates a new context.- Parameters:
areaOfInterest- approximate geographic area of geometries, ornullif unspecified.literal- if a geometry operand is a literal, that literal. Otherwisenull.systemUnit- if the CRS needs to be in some units of measurement, theUnit.getSystemUnit()value.skipIndex- index of the geometry associated tocommonCRS, or -1 if none.- Throws:
org.opengis.util.FactoryException- if an error occurred while fetchingliteralCRS.org.opengis.referencing.operation.TransformException- if a coordinate conversion was required but failed.javax.measure.IncommensurableException- if a coordinate system does not use the expected units.
-
-
Method Details
-
transform
public <G> GeometryWrapper<G> transform(GeometryWrapper<G> geometry) throws org.opengis.util.FactoryException, org.opengis.referencing.operation.TransformException Transforms the specified geometry to the computation CRS. Geometries with unspecified CRS will be used as-is, without transformation. The common CRS is stored in thecommonCRSfield.- Type Parameters:
G- geometry implementation base class.- Parameters:
geometry- the geometry to transform.- Returns:
- the transformed geometry, or the same instance if no transformation was applied.
- Throws:
org.opengis.util.FactoryException- if an error occurred while fetching a CRS.org.opengis.referencing.operation.TransformException- if a coordinate conversion was required but failed.
-
negativeResult
The value to return when a test cannot be applied. This method is defined for having a single place to update if more operator types need to be recognized.- Parameters:
type- the test that could not be applied.- Returns:
- the operation result to assume.
-
negativeResult
The value to return when a test cannot be applied. This method is defined for having a single place to update if more operator types need to be recognized.- Parameters:
type- the test that could not be applied.- Returns:
- the operation result to assume.
-