com.vividsolutions.jts.util
Class GeometricShapeFactory
java.lang.Object
com.vividsolutions.jts.util.GeometricShapeFactory
public class GeometricShapeFactory
extends java.lang.Object
Computes various kinds of common geometric shapes.
Allows various ways of specifying the location and extent of the shapes,
as well as number of line segments used to form them.
LineString | createArc(double startAng, double endAng) - Creates a elliptical arc, as a LineString.
|
Polygon | createCircle() - Creates a circular
Polygon .
|
Polygon | createRectangle() - Creates a rectangular
Polygon .
|
void | setBase(Coordinate base) - Sets the location of the shape by specifying the base coordinate
(which in most cases is the
lower left point of the envelope containing the shape).
|
void | setCentre(Coordinate centre) - Sets the location of the shape by specifying the centre of
the shape's bounding box
|
void | setHeight(double height) - Sets the height of the shape.
|
void | setNumPoints(int nPts) - Sets the total number of points in the created Geometry
|
void | setSize(double size) - Sets the size of the extent of the shape in both x and y directions.
|
void | setWidth(double width) - Sets the width of the shape.
|
GeometricShapeFactory
public GeometricShapeFactory()
Create a shape factory which will create shapes using the default
GeometryFactory
.
GeometricShapeFactory
public GeometricShapeFactory(GeometryFactory geomFact)
Create a shape factory which will create shapes using the given
GeometryFactory
.
geomFact
- the factory to use
createArc
public LineString createArc(double startAng,
double endAng)
Creates a elliptical arc, as a LineString.
createCircle
public Polygon createCircle()
createRectangle
public Polygon createRectangle()
setBase
public void setBase(Coordinate base)
Sets the location of the shape by specifying the base coordinate
(which in most cases is the
lower left point of the envelope containing the shape).
base
- the base coordinate of the shape
setCentre
public void setCentre(Coordinate centre)
Sets the location of the shape by specifying the centre of
the shape's bounding box
centre
- the centre coordinate of the shape
setHeight
public void setHeight(double height)
Sets the height of the shape.
height
- the height of the shape
setNumPoints
public void setNumPoints(int nPts)
Sets the total number of points in the created Geometry
setSize
public void setSize(double size)
Sets the size of the extent of the shape in both x and y directions.
size
- the size of the shape's extent
setWidth
public void setWidth(double width)
Sets the width of the shape.
width
- the width of the shape