|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.util.GeometricShapeFactory
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.
Example:
GeometricShapeFactory gsf = new GeometricShapeFactory(); gsf.setSize(100); gsf.setNumPoints(100); gsf.setBase(new Coordinate(0, 0)); Polygon rect = gsf.createRectangle();
Nested Class Summary | |
protected class |
GeometricShapeFactory.Dimensions
|
Field Summary | |
protected GeometricShapeFactory.Dimensions |
dim
|
protected GeometryFactory |
geomFact
|
protected int |
nPts
|
Constructor Summary | |
GeometricShapeFactory()
Create a shape factory which will create shapes using the default GeometryFactory . |
|
GeometricShapeFactory(GeometryFactory geomFact)
Create a shape factory which will create shapes using the given GeometryFactory . |
Method Summary | |
LineString |
createArc(double startAng,
double endAng)
Creates a elliptical arc, as a LineString. |
Polygon |
createCircle()
Creates a circular Polygon . |
protected Coordinate |
createCoord(double x,
double y)
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GeometryFactory geomFact
protected GeometricShapeFactory.Dimensions dim
protected int nPts
Constructor Detail |
public GeometricShapeFactory()
GeometryFactory
.
public GeometricShapeFactory(GeometryFactory geomFact)
GeometryFactory
.
geomFact
- the factory to useMethod Detail |
public void setBase(Coordinate base)
base
- the base coordinate of the shapepublic void setCentre(Coordinate centre)
centre
- the centre coordinate of the shapepublic void setNumPoints(int nPts)
Geometry
.
The created geometry will have no more than this number of points,
unless more are needed to create a valid geometry.
public void setSize(double size)
size
- the size of the shape's extentpublic void setWidth(double width)
width
- the width of the shapepublic void setHeight(double height)
height
- the height of the shapepublic Polygon createRectangle()
Polygon
.
public Polygon createCircle()
Polygon
.
public LineString createArc(double startAng, double endAng)
protected Coordinate createCoord(double x, double y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |