Class SeededRandomPointsInGridBuilder

java.lang.Object
org.locationtech.jts.shape.GeometricShapeBuilder
org.locationtech.jts.shape.random.RandomPointsInGridBuilder
micycle.pgs.commons.SeededRandomPointsInGridBuilder

public class SeededRandomPointsInGridBuilder extends org.locationtech.jts.shape.random.RandomPointsInGridBuilder
An extension to the RandomPointsInGridBuilder class that accepts a random seed for repeatable outputs.
Author:
Michael Carleton
  • Field Summary

    Fields inherited from class org.locationtech.jts.shape.GeometricShapeBuilder

    extent, geomFactory, numPts
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a builder which will create shapes using the default GeometryFactory.
    SeededRandomPointsInGridBuilder(long seed, org.locationtech.jts.geom.GeometryFactory geomFact)
    Create a builder which will create shapes using the given GeometryFactory.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.locationtech.jts.geom.Geometry
     
    void
    setConstrainedToCircle(boolean isConstrainedToCircle)
    Sets whether generated points are constrained to lie within a circle contained within each grid cell.
    void
    setGutterFraction(double gutterFraction)
    Sets the fraction of the grid cell side which will be treated as a gutter, in which no points will be created.

    Methods inherited from class org.locationtech.jts.shape.GeometricShapeBuilder

    createCoord, getCentre, getDiameter, getExtent, getRadius, getSquareBaseLine, getSquareExtent, setExtent, setNumPoints

    Methods inherited from class java.lang.Object

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

    • SeededRandomPointsInGridBuilder

      public SeededRandomPointsInGridBuilder(long seed)
      Create a builder which will create shapes using the default GeometryFactory.
    • SeededRandomPointsInGridBuilder

      public SeededRandomPointsInGridBuilder(long seed, org.locationtech.jts.geom.GeometryFactory geomFact)
      Create a builder which will create shapes using the given GeometryFactory.
      Parameters:
      geomFact - the factory to use
  • Method Details

    • setConstrainedToCircle

      public void setConstrainedToCircle(boolean isConstrainedToCircle)
      Sets whether generated points are constrained to lie within a circle contained within each grid cell. This provides greater separation between points in adjacent cells.

      The default is to not be constrained to a circle.

      Overrides:
      setConstrainedToCircle in class org.locationtech.jts.shape.random.RandomPointsInGridBuilder
      Parameters:
      isConstrainedToCircle -
    • setGutterFraction

      public void setGutterFraction(double gutterFraction)
      Sets the fraction of the grid cell side which will be treated as a gutter, in which no points will be created. The provided value is clamped to the range [0.0, 1.0].
      Overrides:
      setGutterFraction in class org.locationtech.jts.shape.random.RandomPointsInGridBuilder
      Parameters:
      gutterFraction -
    • getGeometry

      public org.locationtech.jts.geom.Geometry getGeometry()
      Overrides:
      getGeometry in class org.locationtech.jts.shape.random.RandomPointsInGridBuilder