Package micycle.pgs.commons
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
ConstructorsConstructorDescriptionSeededRandomPointsInGridBuilder
(long seed) Create a builder which will create shapes using the defaultGeometryFactory
.SeededRandomPointsInGridBuilder
(long seed, org.locationtech.jts.geom.GeometryFactory geomFact) Create a builder which will create shapes using the givenGeometryFactory
. -
Method Summary
Modifier and TypeMethodDescriptionorg.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
-
Constructor Details
-
SeededRandomPointsInGridBuilder
public SeededRandomPointsInGridBuilder(long seed) Create a builder which will create shapes using the defaultGeometryFactory
. -
SeededRandomPointsInGridBuilder
public SeededRandomPointsInGridBuilder(long seed, org.locationtech.jts.geom.GeometryFactory geomFact) Create a builder which will create shapes using the givenGeometryFactory
.- 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 classorg.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 classorg.locationtech.jts.shape.random.RandomPointsInGridBuilder
- Parameters:
gutterFraction
-
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry()- Overrides:
getGeometry
in classorg.locationtech.jts.shape.random.RandomPointsInGridBuilder
-