public class RandomPointsInGridBuilder extends GeometricShapeBuilder
Modifier and Type | Field and Description |
---|---|
private double |
gutterFraction |
private boolean |
isConstrainedToCircle |
extent, geomFactory, numPts
Constructor and Description |
---|
RandomPointsInGridBuilder()
Create a builder which will create shapes using the default
GeometryFactory . |
RandomPointsInGridBuilder(GeometryFactory geomFact)
Create a builder which will create shapes using the given
GeometryFactory . |
Modifier and Type | Method and Description |
---|---|
Geometry |
getGeometry()
Gets the
MultiPoint containing the generated point |
private Coordinate |
randomPointInCell(double orgX,
double orgY,
double xLen,
double yLen) |
private static Coordinate |
randomPointInCircle(double orgX,
double orgY,
double width,
double height) |
private Coordinate |
randomPointInGridCell(double orgX,
double orgY,
double xLen,
double yLen) |
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.
|
createCoord, getCentre, getDiameter, getExtent, getRadius, getSquareBaseLine, getSquareExtent, setExtent, setNumPoints
private boolean isConstrainedToCircle
private double gutterFraction
public RandomPointsInGridBuilder()
GeometryFactory
.public RandomPointsInGridBuilder(GeometryFactory geomFact)
GeometryFactory
.geomFact
- the factory to usepublic void setConstrainedToCircle(boolean isConstrainedToCircle)
The default is to not be constrained to a circle.
isConstrainedToCircle
- public void setGutterFraction(double gutterFraction)
gutterFraction
- public Geometry getGeometry()
MultiPoint
containing the generated pointgetGeometry
in class GeometricShapeBuilder
private Coordinate randomPointInCell(double orgX, double orgY, double xLen, double yLen)
private Coordinate randomPointInGridCell(double orgX, double orgY, double xLen, double yLen)
private static Coordinate randomPointInCircle(double orgX, double orgY, double width, double height)