Class CutGeometryByGridOp

java.lang.Object
nz.org.riskscape.defaults.geo.CutGeometryByGridOp

public class CutGeometryByGridOp extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    CutGeometryByGridOp(nz.org.riskscape.engine.SRIDSet sridSet)
     
    CutGeometryByGridOp(nz.org.riskscape.engine.SRIDSet sridSet, EnumSet<nz.org.riskscape.engine.geo.GriddedGeometry.Options> options)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.locationtech.jts.geom.Geometry>
    apply(org.locationtech.jts.geom.Geometry geometry, double gridDistance)
    Cut the geometry up into a grid with mesh size of gridDistance.
    List<org.locationtech.jts.geom.Geometry>
    apply(org.locationtech.jts.geom.Geometry geometry, double gridDistance, org.locationtech.jts.geom.Point origin)
    Cut the geometry up into a grid with mesh size of gridDistance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CutGeometryByGridOp

      public CutGeometryByGridOp(nz.org.riskscape.engine.SRIDSet sridSet)
    • CutGeometryByGridOp

      public CutGeometryByGridOp(nz.org.riskscape.engine.SRIDSet sridSet, EnumSet<nz.org.riskscape.engine.geo.GriddedGeometry.Options> options)
  • Method Details

    • apply

      public List<org.locationtech.jts.geom.Geometry> apply(org.locationtech.jts.geom.Geometry geometry, double gridDistance)

      Cut the geometry up into a grid with mesh size of gridDistance. The grid is centred on the geometry being cut which should reduce the number of pieces it is cut into.

      Parameters:
      geometry - the geometry to cut up
      gridDistance - the grid size
      Returns:
      list of new geometries that have been cut to the grid
    • apply

      public List<org.locationtech.jts.geom.Geometry> apply(org.locationtech.jts.geom.Geometry geometry, double gridDistance, org.locationtech.jts.geom.Point origin)

      Cut the geometry up into a grid with mesh size of gridDistance.

      The grid is formed from the origin. The advantage of this is that many geometries can be cut to the same grid.

      Parameters:
      geometry - the geometry to cut up
      gridDistance - the grid size
      origin - the point to align the segmenting relative to
      Returns:
      list of new geometries that have been cut to the grid