E - type of the embedding class
public abstract class BasePolygonBuilder<E extends BasePolygonBuilder<E>> extends ShapeBuilder
BasePolygonBuilder implements the groundwork to create polygons. This contains Methods to wrap polygons at the dateline and building shapes from the data held by the builder. Since this Builder can be embedded to other builders (i.e.
MultiPolygonBuilder) the class of the embedding builder is given by the generic argument
E
| Modifier and Type | Class and Description |
|---|---|
static class |
BasePolygonBuilder
|
ShapeBuilder.CoordinateNode , ShapeBuilder.Edge , ShapeBuilder.GeoShapeType , ShapeBuilder.Orientation ToXContent.DelegatingMapParams , ToXContent.MapParams , ToXContent.Params | Modifier and Type | Field and Description |
|---|---|
protected ArrayList |
holes
|
protected BasePolygonBuilder |
shell
|
static ShapeBuilder |
TYPE
|
autoIndexJtsGeometry, autoValidateJtsGeometry, DATELINE, FACTORY, FIELD_COORDINATES, FIELD_GEOMETRIES, FIELD_ORIENTATION, FIELD_TYPE, INTERSECTION_ORDER, LOGGER, multiPolygonMayOverlap, orientation, SPATIAL_CONTEXT, wrapdatelineEMPTY_PARAMS| Constructor and Description |
|---|
BasePolygonBuilder(ShapeBuilder
|
| Modifier and Type | Method and Description |
|---|---|
com |
build()
Create a new Shape from this builder.
|
Geometry |
buildGeometry(GeometryFactory factory, boolean fixDateline)
|
ShapeBuilder |
close()
Close the shell of the polygon
|
Coordinate |
coordinates()
The coordinates setup by the builder will be assembled to a polygon.
|
protected XContentBuilder |
coordinatesArray(XContentBuilder
|
BasePolygonBuilder |
hole()
build new hole to the polygon
|
E |
hole(BaseLineStringBuilder
Add a new hole to the polygon
|
protected static LinearRing |
linearRing(GeometryFactory factory, ArrayList
|
protected static MultiPolygon |
multipolygon(GeometryFactory factory, Coordinate
Create a Multipolygon from a set of coordinates.
|
E |
point(Coordinate coordinate)
Add a point to the shell of the polygon
|
E |
point(double longitude, double latitude)
|
E |
points(Coordinate
Add a array of points to the shell of the polygon
|
protected static Polygon |
polygon(GeometryFactory factory, Coordinate
|
Polygon |
toPolygon()
|
protected Polygon |
toPolygon(GeometryFactory factory)
|
XContentBuilder |
toXContent(XContentBuilder
|
ShapeBuilder |
type()
get the shapes type
|
protected void |
validateHole(BaseLineStringBuilder
Validates only 1 vertex is tangential (shared) between the interior and exterior of a polygon
|
coordinate, debugEnabled, intersection, intersections, jtsGeometry, newCircleBuilder, newEnvelope, newEnvelope, newGeometryCollection, newGeometryCollection, newLineString, newMultiLinestring, newMultiPoint, newMultiPolygon, newMultiPolygon, newPoint, newPoint, newPolygon, newPolygon, orientationFromString, parse, parse, shift, toStringpublic static final ShapeBuilder.GeoShapeType TYPE
protected BasePolygonBuilder.Ring <E extends BasePolygonBuilder <E>> shell
protected final ArrayList<BaseLineStringBuilder <?>> holes
public BasePolygonBuilder(ShapeBuilder.Orientation orientation)
public E point(double longitude, double latitude)
public E point(Coordinate coordinate)
coordinate - coordinate of the new point
public E points(Coordinate... coordinates)
coordinates - coordinates of the new points to add
public E hole(BaseLineStringBuilder<?> hole)
hole - linear ring defining the hole
public BasePolygonBuilder.Ring <E> hole()
hole - linear ring defining the hole
public ShapeBuilderclose()
protected void validateHole(BaseLineStringBuildershell, BaseLineStringBuilder hole)
public Coordinate[][][] coordinates()
public com.spatial4j .core .shape .Shape build()
ShapeBuilder
build in class
ShapeBuilder
Shape defined by the builder
protected XContentBuildercoordinatesArray(XContentBuilder builder, ToXContent .Params params) throws IOException
IOException
public XContentBuildertoXContent(XContentBuilder builder, ToXContent .Params params) throws IOException
toXContent in interface
ToXContent
toXContent in class
ShapeBuilder
IOException
public Geometry buildGeometry(GeometryFactory factory,
boolean fixDateline)public Polygon toPolygon()
protected Polygon toPolygon(GeometryFactory factory)
protected static LinearRing linearRing(GeometryFactory factory,
ArrayList<Coordinate> coordinates) public ShapeBuilder.GeoShapeType type()
ShapeBuilder
type in class
ShapeBuilder
protected static Polygon polygon(GeometryFactory factory,
Coordinate[][] polygon) protected static MultiPolygon multipolygon(GeometryFactory factory,
Coordinate[][][] polygons)
factory -
GeometryFactory to use
polygons - definition of polygons