|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGeometryBuilder
public class GeometryBuilder
A builder for Geometry
objects. Primarily intended to
support fluent programming in test code.
Features include:
CoordinateSequenceFactory
supports them)
Examples of intended usage are:
GeometryBuilder gb = new GeometryBuilder(geomFact); LineString line = gb.linestring(1,2, 3,4); Polygon poly = gb.polygon(0,0, 0,1, 1,1, 1,0); Polygon box = gb.box(0,0, 1,1); Polygon hexagon = gb.circle(0,0, 1,1, 6); Polygon polyhole = gb.polygon(gb.linearring(0,0, 0,10, 10,10, 10,0), gb.linearring(1,1, 1,9, 9,9, 9,1))
Constructor Summary | |
---|---|
GeometryBuilder()
Create a new instance using the default GeometryFactory . |
|
GeometryBuilder(GeometryFactory geomFact)
Creates a new instance using a provided GeometryFactory. |
Method Summary | |
---|---|
Polygon |
box(double x1,
double y1,
double x2,
double y2)
Creates a rectangular 2D Polygon from X and Y bounds. |
Polygon |
boxZ(double x1,
double y1,
double x2,
double y2,
double z)
Creates a rectangular 3D Polygon from X and Y bounds. |
Polygon |
circle(double x,
double y,
double radius,
int nsides)
Creates a circular Polygon with a given center, radius and number of sides. |
Polygon |
ellipse(double x1,
double y1,
double x2,
double y2,
int nsides)
Creates an elliptical Polygon from a bounding box with a given number of sides. |
GeometryCollection |
geometryCollection(Geometry... geoms)
Creates a GeometryCollection from a set of Geometrys |
LinearRing |
linearRing()
Creates an empty 2D LinearRing |
LinearRing |
linearRing(double... ord)
Creates a 2D LinearRing. |
LinearRing |
linearRingZ()
Creates an empty 3D LinearRing |
LinearRing |
linearRingZ(double... ord)
Creates a 3D LinearRing. |
LineString |
lineString()
Creates an empty 2D LineString |
LineString |
lineString(double... ord)
Creates a 2D LineString. |
LineString |
lineStringZ()
Creates an empty 3D LineString |
LineString |
lineStringZ(double... ord)
Creates a 3D LineString. |
MultiLineString |
multiLineString(LineString... lines)
Creates a MultiLineString from a set of LineStrings |
MultiPoint |
multiPoint(double x1,
double y1,
double x2,
double y2)
Creates a MultiPoint with 2 2D Points. |
MultiPoint |
multiPointZ(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Creates a MultiPoint with 2 3D Points. |
MultiPolygon |
multiPolygon(Polygon... polys)
Creates a MultiPolygon from a set of Polygons. |
Point |
point()
Creates an empty Point |
Point |
point(double x)
Creates a 1D Point. |
Point |
point(double x,
double y)
Creates a 2D Point. |
Point |
pointZ()
Creates an empty Point with coordinate dimension = 3. |
Point |
pointZ(double x,
double y,
double z)
Creates a 3D Point. |
Polygon |
polygon()
Creates an empty 2D Polygon. |
Polygon |
polygon(double... ord)
Creates a Polygon from a list of XY coordinates. |
Polygon |
polygon(LinearRing shell)
Creates a Polygon from an exterior ring. |
Polygon |
polygon(LinearRing shell,
LinearRing hole)
Creates a Polygon with a hole from an exterior ring and an interior ring. |
Polygon |
polygon(Polygon shell,
Polygon hole)
Creates a Polygon with a hole from an exterior ring and an interior ring supplied by the rings of Polygons. |
Polygon |
polygonZ()
Creates an empty 3D Polygon. |
Polygon |
polygonZ(double... ord)
Creates a Polygon from a list of XYZ coordinates. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeometryBuilder()
GeometryFactory
.
public GeometryBuilder(GeometryFactory geomFact)
geomFact
- the factory to useMethod Detail |
---|
public Point point()
public Point pointZ()
public Point point(double x)
x
- the X ordinate
public Point point(double x, double y)
x
- the X ordinatey
- the Y ordinate
public Point pointZ(double x, double y, double z)
x
- the X ordinatey
- the Y ordinatez
- the Z ordinate
public LineString lineString()
public LineString lineStringZ()
public LineString lineString(double... ord)
ord
- the XY ordinates
public LineString lineStringZ(double... ord)
ord
- the XYZ ordinates
public LinearRing linearRing()
public LinearRing linearRingZ()
public LinearRing linearRing(double... ord)
ord
-
public LinearRing linearRingZ(double... ord)
ord
- the XYZ ordinates
public Polygon polygon()
public Polygon polygonZ()
public Polygon polygon(double... ord)
ord
- a list of XY ordinates
public Polygon polygonZ(double... ord)
ord
- a list of XYZ ordinates
public Polygon polygon(LinearRing shell)
shell
- the exterior ring
public Polygon polygon(LinearRing shell, LinearRing hole)
shell
- the exterior ringhole
- the interior ring
public Polygon polygon(Polygon shell, Polygon hole)
shell
- the exterior ringhole
- the interior ring
public Polygon box(double x1, double y1, double x2, double y2)
x1
- the lower X boundy1
- the lower Y boundx2
- the upper X boundy2
- the upper Y bound
public Polygon boxZ(double x1, double y1, double x2, double y2, double z)
x1
- the lower X boundy1
- the lower Y boundx2
- the upper X boundy2
- the upper Y boundz
- the Z value for all coordinates
public Polygon ellipse(double x1, double y1, double x2, double y2, int nsides)
x1
- y1
- x2
- y2
- nsides
-
public Polygon circle(double x, double y, double radius, int nsides)
x
- the center X ordinatey
- the center Y ordinateradius
- the radiusnsides
- the number of sides
public MultiPoint multiPoint(double x1, double y1, double x2, double y2)
x1
- the X ordinate of the first pointy1
- the Y ordinate of the first pointx2
- the X ordinate of the second pointy2
- the Y ordinate of the second point
public MultiPoint multiPointZ(double x1, double y1, double z1, double x2, double y2, double z2)
x1
- the X ordinate of the first pointy1
- the Y ordinate of the first pointz1
- the Z ordinate of the first pointx2
- the X ordinate of the second pointy2
- the Y ordinate of the second pointz2
- the Z ordinate of the second point
public MultiLineString multiLineString(LineString... lines)
lines
- the component LineStrings
public MultiPolygon multiPolygon(Polygon... polys)
polys
- the component polygons
public GeometryCollection geometryCollection(Geometry... geoms)
geoms
- the component Geometrys
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |