Class RecursiveQuadGridOp.Result

java.lang.Object
nz.org.riskscape.engine.geo.RecursiveQuadGridOp.Result
Enclosing class:
RecursiveQuadGridOp

public static class RecursiveQuadGridOp.Result extends Object

All the bits and pieces involved in the recursive quadding, plus ways of accessing it

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final nz.org.riskscape.engine.util.SegmentedList<org.locationtech.jts.geom.Geometry>
    The irregular pieces of the original geometry that could not be cut into uniform squares
    final org.locationtech.jts.geom.GeometryFactory
    A geometry factory to use for creating new geometries from squares
    final double
    Size of the grid in map units, NB gridSize² gives the area of each grid cell.
    final int
    Maximum recursion depth - our envelope should match the grid size at this point.
    final nz.org.riskscape.engine.geo.BlockBasedSquareList
    Uniform squares that comprise part of the original input geometry.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Result(org.locationtech.jts.geom.Geometry geometry, double gridSize, org.locationtech.jts.geom.Coordinate alignTo)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<? extends org.locationtech.jts.geom.Geometry>
    The list of blocks we built when recursing, as polygons.
    List<? extends org.locationtech.jts.geom.Geometry>
    A list of all the grid cell/feature intersections
    org.locationtech.jts.geom.Envelope
     

    Methods inherited from class java.lang.Object

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

    • gridSize

      public final double gridSize

      Size of the grid in map units, NB gridSize² gives the area of each grid cell.

    • factory

      public final org.locationtech.jts.geom.GeometryFactory factory

      A geometry factory to use for creating new geometries from squares

    • cuts

      public final nz.org.riskscape.engine.util.SegmentedList<org.locationtech.jts.geom.Geometry> cuts

      The irregular pieces of the original geometry that could not be cut into uniform squares

    • squares

      public final nz.org.riskscape.engine.geo.BlockBasedSquareList squares

      Uniform squares that comprise part of the original input geometry. Rather than cutting grid-size pieces out of the original geometry (expensive!), we can construct the grid-size pieces much more quickly from these larger squares. This works because the large squares measure a power-of-two of the gridSize and are already aligned.

    • maxDepth

      public final int maxDepth

      Maximum recursion depth - our envelope should match the grid size at this point. NB we use a precomputed depth to avoid having to do a fuzzy comparison of the envelope's size, which can be inaccurate with floating point maths and storing numbers like 0.1 in binary

  • Constructor Details

    • Result

      public Result(org.locationtech.jts.geom.Geometry geometry, double gridSize, org.locationtech.jts.geom.Coordinate alignTo)
  • Method Details

    • getStartingEnvelope

      public org.locationtech.jts.geom.Envelope getStartingEnvelope()
      Returns:
      a copy of the envelope that was determined to: 1 - encompass the at least the entire geometry 2 - be recursively divisible in to squares of size gridSize² 3 - have its center 'snapped' to a grid defined by alignTo and gridSize
    • getBlockList

      public List<? extends org.locationtech.jts.geom.Geometry> getBlockList()

      The list of blocks we built when recursing, as polygons. Can be useful for debugging/visualising how the algorithm works

    • getCombinedResult

      public List<? extends org.locationtech.jts.geom.Geometry> getCombinedResult()

      A list of all the grid cell/feature intersections