public class GeomBuilder
extends java.lang.Object
Example usage:
GeometryBuilder gb = new GeometryBuilder();
// create array two 2d points and turn into a line string
gb.points(1,2,3,4,5,6).toLineString();
// build a polygon with holes
gb.points(0,0,10,0,10,10,0,10,0,0).ring()
.points(4,4,6,4,6,6,4,6,4,4).ring()
.toPolygon();
| Constructor and Description |
|---|
GeomBuilder()
Constructs a builder with the default geometry factory.
|
GeomBuilder(com.vividsolutions.jts.geom.GeometryFactory factory)
Constructs a builder with an explicit geometry factory.
|
GeomBuilder(int srid)
Constructs a builder with a specific srid for geometry objects.
|
| Modifier and Type | Method and Description |
|---|---|
GeomBuilder |
buffer(double amt)
Buffers the geometry at the top of the geometry stack, and places the
result back on the
geometry stack.
|
GeomBuilder |
collection()
Creates a GeometryCollection from all Geometries on the geometry stack
and places the result
back on the geometry stack.
|
com.vividsolutions.jts.geom.Geometry |
get()
Consumes the top of the geometry stack.
|
GeomBuilder |
lineString()
Creates a LineString from all points on the coordinate stack, and places
the result
on the geometry stack.
|
GeomBuilder |
multiLineString()
Creates a MultiLineString from all LineStrings on the geometry stack and
places the result
back on the geometry stack.
|
GeomBuilder |
multiPoint()
Creates a MultiPoint from all coordinates on the coordinate stack,
plaching the result
back on the geometry stack.
|
GeomBuilder |
multiPolygon()
Creates a MultiPolygon from all Polygons on the geometry stack and places
the result
back on the geometry stack.
|
GeomBuilder |
point()
Creates a Point from the last point on the coordinate stack, and places
the result
on the geometry stack.
|
GeomBuilder |
point(double x,
double y)
Adds a 2d point to the coordinate stack.
|
GeomBuilder |
points(double... ord)
Adds an array of 2d points to the coordinate stack.
|
GeomBuilder |
pointsz(double... ord)
Adds an array of 3d points to the coordinate stack.
|
GeomBuilder |
pointz(double x,
double y,
double z)
Adds a 3d point to the coordinate stack.
|
GeomBuilder |
polygon()
Creates a Polygon from all LinearRings on the geometry stack and places
the result back
on the geometry stack.
|
GeomBuilder |
ring()
Creates a LinearRing from all points on the coordinate stack, and places
the result
on the geometry stack.
|
com.vividsolutions.jts.geom.GeometryCollection |
toCollection()
Builds and returns a GEometryCollection.
|
com.vividsolutions.jts.geom.LinearRing |
toLinearRing()
Builds and returns a LineString.
|
com.vividsolutions.jts.geom.LineString |
toLineString()
Builds and returns a LineString.
|
com.vividsolutions.jts.geom.MultiLineString |
toMultiLineString()
Builds and returns a MultiLineString.
|
com.vividsolutions.jts.geom.MultiPoint |
toMultiPoint()
Builds and returns a MultiPoint.
|
com.vividsolutions.jts.geom.MultiPolygon |
toMultiPolygon()
Builds and returns a MultiPolygon.
|
com.vividsolutions.jts.geom.Point |
toPoint()
Builds and returns a Point.
|
com.vividsolutions.jts.geom.Polygon |
toPolygon()
Builds and returns a Polygon.
|
public GeomBuilder()
public GeomBuilder(com.vividsolutions.jts.geom.GeometryFactory factory)
public GeomBuilder(int srid)
public GeomBuilder point(double x, double y)
public GeomBuilder pointz(double x, double y, double z)
public GeomBuilder points(double... ord)
public GeomBuilder pointsz(double... ord)
public GeomBuilder point()
public GeomBuilder lineString()
public GeomBuilder ring()
If the first and last coordinate on the point stack are not equal an additional point will be added.
public GeomBuilder polygon()
public GeomBuilder multiPoint()
If the coordinate stack is empty this method will consume all Point geometries on the geometry stack.
public GeomBuilder multiLineString()
public GeomBuilder multiPolygon()
public GeomBuilder collection()
public GeomBuilder buffer(double amt)
public com.vividsolutions.jts.geom.Geometry get()
public com.vividsolutions.jts.geom.Point toPoint()
This method is equivalent to:
(Point) point().get();
public com.vividsolutions.jts.geom.LineString toLineString()
This method is equivalent to:
(LineString) lineString().get();
public com.vividsolutions.jts.geom.LinearRing toLinearRing()
This method is equivalent to:
(LinearRing) ring().get();
public com.vividsolutions.jts.geom.Polygon toPolygon()
This method is equivalent to:
(Polygon) polygon().get();
public com.vividsolutions.jts.geom.MultiPoint toMultiPoint()
This method is equivalent to:
(MultiPoint) multiPoint().get();
public com.vividsolutions.jts.geom.MultiLineString toMultiLineString()
This method is equivalent to:
(MultiLineString) multiLineString().get();
public com.vividsolutions.jts.geom.MultiPolygon toMultiPolygon()
This method is equivalent to:
(MultiPolygon) multiPolygon().get();
public com.vividsolutions.jts.geom.GeometryCollection toCollection()
This method is equivalent to:
(GeometryCollection) collection().get();