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

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
     
  • Field Summary

    Fields inherited from interface nz.org.riskscape.engine.projection.Projection

    IDENTITY
  • Constructor Summary

    Constructors
    Constructor
    Description
    ValidateGeometryProjection(nz.org.riskscape.engine.geo.GeometryValidation mode, Object context, nz.org.riskscape.problem.ProblemSink problemSink)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface nz.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 interface nz.org.riskscape.engine.projection.Projection