Class ValidateGeometryProjection
java.lang.Object
nz.org.riskscape.engine.projection.ValidateGeometryProjection
- All Implemented Interfaces:
nz.org.riskscape.engine.projection.Projection
public class ValidateGeometryProjection
extends Object
implements nz.org.riskscape.engine.projection.Projection
A projection that detects any invalid Geometry
and throws InvalidTupleException
should
an invalid geometry be found.
Note that this projector only checks geometries that are in the top level of the sourceType (nested
geometry members are not checked). If there are no geometries in the top level of sourceType of if
mode is GeometryValidation.OFF
then the affect is an identity projection.
Invalid Geometry can cause TopologyExceptions later if we try to manipulate the Geometry at all (i.e. take an intersection). It's simpler to alert the user at this point rather than trying to catch a TopologyException later.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
-
Field Summary
Fields inherited from interface nz.org.riskscape.engine.projection.Projection
IDENTITY
-
Constructor Summary
ConstructorDescriptionValidateGeometryProjection
(nz.org.riskscape.engine.geo.GeometryValidation mode, Object context, nz.org.riskscape.problem.ProblemSink problemSink) -
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.projection.Projector>
getProjectionFunction
(nz.org.riskscape.engine.types.Struct sourceType) nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.types.Struct>
projectType
(nz.org.riskscape.engine.types.Struct source)
-
Constructor Details
-
ValidateGeometryProjection
public ValidateGeometryProjection(nz.org.riskscape.engine.geo.GeometryValidation mode, Object context, nz.org.riskscape.problem.ProblemSink problemSink)
-
-
Method Details
-
projectType
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.types.Struct> projectType(nz.org.riskscape.engine.types.Struct source) - Specified by:
projectType
in interfacenz.org.riskscape.engine.projection.Projection
-
getProjectionFunction
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.projection.Projector> getProjectionFunction(nz.org.riskscape.engine.types.Struct sourceType) - Specified by:
getProjectionFunction
in interfacenz.org.riskscape.engine.projection.Projection
-