Package org.meteoinfo.jts.shape.random
Class RandomPointsBuilder
- java.lang.Object
-
- org.meteoinfo.jts.shape.GeometricShapeBuilder
-
- org.meteoinfo.jts.shape.random.RandomPointsBuilder
-
public class RandomPointsBuilder extends GeometricShapeBuilder
Creates random point sets contained in a region defined by either a rectangular or a polygonal extent.
-
-
Field Summary
Fields Modifier and Type Field Description protected GeometrymaskPoly-
Fields inherited from class org.meteoinfo.jts.shape.GeometricShapeBuilder
extent, geomFactory, numPts
-
-
Constructor Summary
Constructors Constructor Description RandomPointsBuilder()Create a shape factory which will create shapes using the defaultGeometryFactory.RandomPointsBuilder(GeometryFactory geomFact)Create a shape factory which will create shapes using the givenGeometryFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CoordinatecreateCoord(double x, double y)protected CoordinatecreateRandomCoord(Envelope env)GeometrygetGeometry()protected booleanisInExtent(Coordinate p)voidsetExtent(Geometry mask)Sets a polygonal mask.-
Methods inherited from class org.meteoinfo.jts.shape.GeometricShapeBuilder
getCentre, getDiameter, getExtent, getRadius, getSquareBaseLine, getSquareExtent, setExtent, setNumPoints
-
-
-
-
Field Detail
-
maskPoly
protected Geometry maskPoly
-
-
Constructor Detail
-
RandomPointsBuilder
public RandomPointsBuilder()
Create a shape factory which will create shapes using the defaultGeometryFactory.
-
RandomPointsBuilder
public RandomPointsBuilder(GeometryFactory geomFact)
Create a shape factory which will create shapes using the givenGeometryFactory.- Parameters:
geomFact- the factory to use
-
-
Method Detail
-
setExtent
public void setExtent(Geometry mask)
Sets a polygonal mask.- Parameters:
mask-- Throws:
java.lang.IllegalArgumentException- if the mask is not polygonal
-
getGeometry
public Geometry getGeometry()
- Specified by:
getGeometryin classGeometricShapeBuilder
-
isInExtent
protected boolean isInExtent(Coordinate p)
-
createCoord
protected Coordinate createCoord(double x, double y)
- Overrides:
createCoordin classGeometricShapeBuilder
-
createRandomCoord
protected Coordinate createRandomCoord(Envelope env)
-
-