public abstract class CoordinateCollection<E extends CoordinateCollection<E>> extends ShapeBuilder
CoordinateCollection
is an abstract base implementation for LineStringBuilder
and MultiPointBuilder
.
It holds a common list of Coordinate
, provides setters for adding elements to the list and can render this to XContent.ShapeBuilder.CoordinateNode, ShapeBuilder.Edge, ShapeBuilder.GeoShapeType, ShapeBuilder.Orientation
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected java.util.List<com.vividsolutions.jts.geom.Coordinate> |
coordinates |
AUTO_INDEX_JTS_GEOMETRY, AUTO_VALIDATE_JTS_GEOMETRY, DATELINE, FACTORY, FIELD_COORDINATES, FIELD_GEOMETRIES, FIELD_ORIENTATION, FIELD_TYPE, INTERSECTION_ORDER, LOGGER, MULTI_POLYGON_MAY_OVERLAP, SPATIAL_CONTEXT, wrapdateline, ZERO_ZERO
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
CoordinateCollection(java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates)
Construct a new collection of coordinates.
|
protected |
CoordinateCollection(StreamInput in)
Read from a stream.
|
Modifier and Type | Method and Description |
---|---|
E |
coordinate(com.vividsolutions.jts.geom.Coordinate coordinate)
Add a new coordinate to the collection
|
E |
coordinate(double longitude,
double latitude)
Add a new coordinate to the collection
|
protected com.vividsolutions.jts.geom.Coordinate[] |
coordinates(boolean closed)
Copy all coordinate to a new Array
|
E |
coordinates(java.util.Collection<? extends com.vividsolutions.jts.geom.Coordinate> coordinates)
Add a collection of coordinates to the collection
|
E |
coordinates(com.vividsolutions.jts.geom.Coordinate... coordinates)
Add a array of coordinates to the collection
|
protected XContentBuilder |
coordinatesToXcontent(XContentBuilder builder,
boolean closed)
builds an array of coordinates to a
XContentBuilder |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
build, debugEnabled, getWriteableName, intersection, intersections, jtsGeometry, parse, parse, readFromStream, shift, toXContent, type, writeCoordinateTo
buildAsBytes, buildAsBytes, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFragment, toXContent
protected final java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates
protected CoordinateCollection(java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates)
coordinates
- an initial list of coordinatesjava.lang.IllegalArgumentException
- if coordinates is null or emptyprotected CoordinateCollection(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
java.io.IOException
public E coordinate(double longitude, double latitude)
longitude
- longitude of the coordinatelatitude
- latitude of the coordinatepublic E coordinate(com.vividsolutions.jts.geom.Coordinate coordinate)
coordinate
- coordinate of the pointpublic E coordinates(com.vividsolutions.jts.geom.Coordinate... coordinates)
coordinates
- array of Coordinate
s to addpublic E coordinates(java.util.Collection<? extends com.vividsolutions.jts.geom.Coordinate> coordinates)
coordinates
- array of Coordinate
s to addprotected com.vividsolutions.jts.geom.Coordinate[] coordinates(boolean closed)
closed
- if set to true the first point of the array is repeated as last elementprotected XContentBuilder coordinatesToXcontent(XContentBuilder builder, boolean closed) throws java.io.IOException
XContentBuilder
builder
- builder to useclosed
- repeat the first point at the end of the array if it's not already defines as last element of the arrayjava.io.IOException