Class RecursiveQuadGridOp.Result
- Enclosing class:
- RecursiveQuadGridOp
All the bits and pieces involved in the recursive quadding, plus ways of accessing it
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List<org.locationtech.jts.geom.Geometry>The irregular pieces of the original geometry that could not be cut into uniform squaresfinal org.locationtech.jts.geom.GeometryFactoryA geometry factory to use for creating new geometries from squaresfinal doubleSize of the grid in map units, NB gridSize² gives the area of each grid cell.final intMaximum recursion depth - our envelope should match the grid size at this point.final nz.org.riskscape.engine.geo.BlockBasedSquareListUniform squares that comprise part of the original input geometry. -
Constructor Summary
ConstructorsConstructorDescriptionResult(org.locationtech.jts.geom.Geometry geometry, double gridSize, org.locationtech.jts.geom.Coordinate alignTo) -
Method Summary
-
Field Details
-
gridSize
public final double gridSizeSize of the grid in map units, NB gridSize² gives the area of each grid cell.
-
factory
public final org.locationtech.jts.geom.GeometryFactory factoryA geometry factory to use for creating new geometries from squares
-
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 squaresUniform 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 maxDepthMaximum 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
The list of blocks we built when recursing, as polygons. Can be useful for debugging/visualising how the algorithm works
-
getCombinedResult
A list of all the grid cell/feature intersections
-