JTS Topology Suite version 1.13

com.vividsolutions.jts.shape.random
Class RandomPointsBuilder

java.lang.Object
  extended by com.vividsolutions.jts.shape.GeometricShapeBuilder
      extended by com.vividsolutions.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.

Author:
mbdavis

Field Summary
protected  Geometry maskPoly
           
 
Fields inherited from class com.vividsolutions.jts.shape.GeometricShapeBuilder
extent, geomFactory, numPts
 
Constructor Summary
RandomPointsBuilder()
          Create a shape factory which will create shapes using the default GeometryFactory.
RandomPointsBuilder(GeometryFactory geomFact)
          Create a shape factory which will create shapes using the given GeometryFactory.
 
Method Summary
protected  Coordinate createCoord(double x, double y)
           
protected  Coordinate createRandomCoord(Envelope env)
           
 Geometry getGeometry()
           
protected  boolean isInExtent(Coordinate p)
           
 void setExtent(Geometry mask)
          Sets a polygonal mask.
 
Methods inherited from class com.vividsolutions.jts.shape.GeometricShapeBuilder
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
 

Field Detail

maskPoly

protected Geometry maskPoly
Constructor Detail

RandomPointsBuilder

public RandomPointsBuilder()
Create a shape factory which will create shapes using the default GeometryFactory.


RandomPointsBuilder

public RandomPointsBuilder(GeometryFactory geomFact)
Create a shape factory which will create shapes using the given GeometryFactory.

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:
getGeometry in class GeometricShapeBuilder

isInExtent

protected boolean isInExtent(Coordinate p)

createCoord

protected Coordinate createCoord(double x,
                                 double y)
Overrides:
createCoord in class GeometricShapeBuilder

createRandomCoord

protected Coordinate createRandomCoord(Envelope env)

JTS Topology Suite version 1.13