Package org.meteoinfo.jts.shape.random
Class RandomPointsInGridBuilder
- java.lang.Object
-
- org.meteoinfo.jts.shape.GeometricShapeBuilder
-
- org.meteoinfo.jts.shape.random.RandomPointsInGridBuilder
-
public class RandomPointsInGridBuilder extends GeometricShapeBuilder
Creates random point sets where the points are constrained to lie in the cells of a grid.
-
-
Field Summary
-
Fields inherited from class org.meteoinfo.jts.shape.GeometricShapeBuilder
extent, geomFactory, numPts
-
-
Constructor Summary
Constructors Constructor Description RandomPointsInGridBuilder()Create a builder which will create shapes using the defaultGeometryFactory.RandomPointsInGridBuilder(GeometryFactory geomFact)Create a builder which will create shapes using the givenGeometryFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometrygetGeometry()Gets theMultiPointcontaining the generated pointvoidsetConstrainedToCircle(boolean isConstrainedToCircle)Sets whether generated points are constrained to lie within a circle contained within each grid cell.voidsetGutterFraction(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.meteoinfo.jts.shape.GeometricShapeBuilder
createCoord, getCentre, getDiameter, getExtent, getRadius, getSquareBaseLine, getSquareExtent, setExtent, setNumPoints
-
-
-
-
Constructor Detail
-
RandomPointsInGridBuilder
public RandomPointsInGridBuilder()
Create a builder which will create shapes using the defaultGeometryFactory.
-
RandomPointsInGridBuilder
public RandomPointsInGridBuilder(GeometryFactory geomFact)
Create a builder which will create shapes using the givenGeometryFactory.- Parameters:
geomFact- the factory to use
-
-
Method Detail
-
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.
- 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].- Parameters:
gutterFraction-
-
getGeometry
public Geometry getGeometry()
Gets theMultiPointcontaining the generated point- Specified by:
getGeometryin classGeometricShapeBuilder- Returns:
- a MultiPoint
-
-