NamedWriteable
, Writeable
, ToXContent
, ToXContentObject
CircleBuilder
, EnvelopeBuilder
, GeometryCollectionBuilder
, LineStringBuilder
, MultiLineStringBuilder
, MultiPointBuilder
, MultiPolygonBuilder
, PointBuilder
, PolygonBuilder
public abstract class ShapeBuilder<T extends org.locationtech.spatial4j.shape.Shape,E extends ShapeBuilder<T,E>> extends java.lang.Object implements NamedWriteable, ToXContentObject
Modifier and Type | Class | Description |
---|---|---|
protected static class |
ShapeBuilder.Edge |
This helper class implements a linked list for
Coordinate . |
static class |
ShapeBuilder.Orientation |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
protected static boolean |
AUTO_INDEX_JTS_GEOMETRY |
|
protected static boolean |
AUTO_VALIDATE_JTS_GEOMETRY |
|
protected java.util.List<com.vividsolutions.jts.geom.Coordinate> |
coordinates |
|
static double |
DATELINE |
|
static com.vividsolutions.jts.geom.GeometryFactory |
FACTORY |
|
protected static org.elasticsearch.common.geo.builders.ShapeBuilder.IntersectionOrder |
INTERSECTION_ORDER |
|
protected static org.apache.logging.log4j.Logger |
LOGGER |
|
protected static boolean |
MULTI_POLYGON_MAY_OVERLAP |
It's possible that some geometries in a MULTI* shape might overlap.
|
static org.locationtech.spatial4j.context.jts.JtsSpatialContext |
SPATIAL_CONTEXT |
|
protected boolean |
wrapdateline |
We're expecting some geometries might cross the dateline.
|
static com.vividsolutions.jts.geom.Coordinate |
ZERO_ZERO |
coordinate at [0.0, 0.0]
|
EMPTY_PARAMS
Modifier | Constructor | Description |
---|---|---|
protected |
ShapeBuilder() |
default ctor
|
protected |
ShapeBuilder(java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates) |
ctor from list of coordinates
|
protected |
ShapeBuilder(StreamInput in) |
ctor from serialized stream input
|
Modifier and Type | Method | Description |
---|---|---|
abstract T |
build() |
Create a new Shape from this builder.
|
protected java.lang.StringBuilder |
contentToWKT() |
|
E |
coordinate(double longitude,
double latitude) |
Add a new coordinate to the collection
|
E |
coordinate(com.vividsolutions.jts.geom.Coordinate coordinate) |
Add a new coordinate to the collection
|
protected static java.lang.StringBuilder |
coordinateListToWKT(java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates) |
|
protected com.vividsolutions.jts.geom.Coordinate[] |
coordinates(boolean closed) |
Copy all coordinate to a new Array
|
E |
coordinates(com.vividsolutions.jts.geom.Coordinate... coordinates) |
Add a array of coordinates to the collection
|
E |
coordinates(java.util.Collection<? extends com.vividsolutions.jts.geom.Coordinate> coordinates) |
Add a collection of coordinates to the collection
|
protected XContentBuilder |
coordinatesToXcontent(XContentBuilder builder,
boolean closed) |
builds an array of coordinates to a
XContentBuilder |
protected static boolean |
debugEnabled() |
|
boolean |
equals(java.lang.Object o) |
|
java.lang.String |
getWriteableName() |
Returns the name of the writeable object
|
int |
hashCode() |
|
protected static double |
intersection(com.vividsolutions.jts.geom.Coordinate p1,
com.vividsolutions.jts.geom.Coordinate p2,
double dateline) |
Calculate the intersection of a line segment and a vertical dateline.
|
protected static int |
intersections(double dateline,
ShapeBuilder.Edge[] edges) |
Calculate all intersections of line segments and a vertical line.
|
protected org.locationtech.spatial4j.shape.jts.JtsGeometry |
jtsGeometry(com.vividsolutions.jts.geom.Geometry geom) |
|
static ShapeBuilder |
parse(XContentParser parser) |
Deprecated.
this method will be removed in a future version; use ShapeParser.parse instead
|
protected static com.vividsolutions.jts.geom.Coordinate |
readFromStream(StreamInput in) |
|
protected static com.vividsolutions.jts.geom.Coordinate |
shift(com.vividsolutions.jts.geom.Coordinate coordinate,
double dateline) |
|
java.lang.String |
toString() |
|
java.lang.String |
toWKT() |
|
protected static XContentBuilder |
toXContent(XContentBuilder builder,
com.vividsolutions.jts.geom.Coordinate coordinate) |
|
abstract GeoShapeType |
type() |
get the shapes type
|
protected static void |
writeCoordinateTo(com.vividsolutions.jts.geom.Coordinate coordinate,
StreamOutput out) |
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toXContent
isFragment
protected static final org.apache.logging.log4j.Logger LOGGER
protected final java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates
public static final double DATELINE
public static final com.vividsolutions.jts.geom.Coordinate ZERO_ZERO
public static final org.locationtech.spatial4j.context.jts.JtsSpatialContext SPATIAL_CONTEXT
public static final com.vividsolutions.jts.geom.GeometryFactory FACTORY
protected final boolean wrapdateline
protected static final boolean MULTI_POLYGON_MAY_OVERLAP
protected static final boolean AUTO_VALIDATE_JTS_GEOMETRY
JtsGeometry.validate()
,
Constant Field Valuesprotected static final boolean AUTO_INDEX_JTS_GEOMETRY
JtsGeometry.index()
,
Constant Field Valuesprotected static final org.elasticsearch.common.geo.builders.ShapeBuilder.IntersectionOrder INTERSECTION_ORDER
protected ShapeBuilder()
protected ShapeBuilder(java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates)
protected ShapeBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected static com.vividsolutions.jts.geom.Coordinate readFromStream(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
protected static void writeCoordinateTo(com.vividsolutions.jts.geom.Coordinate coordinate, StreamOutput out) throws java.io.IOException
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 org.locationtech.spatial4j.shape.jts.JtsGeometry jtsGeometry(com.vividsolutions.jts.geom.Geometry geom)
public abstract T build()
Shape
defined by the builderprotected static com.vividsolutions.jts.geom.Coordinate shift(com.vividsolutions.jts.geom.Coordinate coordinate, double dateline)
public abstract GeoShapeType type()
protected static final double intersection(com.vividsolutions.jts.geom.Coordinate p1, com.vividsolutions.jts.geom.Coordinate p2, double dateline)
p1
- start-point of the line segmentp2
- end-point of the line segmentdateline
- x-coordinate of the vertical datelineDouble.NaN
protected static int intersections(double dateline, ShapeBuilder.Edge[] edges)
dateline
- x-coordinate of the datelineedges
- set of edges that may intersect with the datelineprotected java.lang.StringBuilder contentToWKT()
public java.lang.String toWKT()
protected static java.lang.StringBuilder coordinateListToWKT(java.util.List<com.vividsolutions.jts.geom.Coordinate> coordinates)
protected static final boolean debugEnabled()
@Deprecated public static ShapeBuilder parse(XContentParser parser) throws java.io.IOException
java.io.IOException
protected static XContentBuilder toXContent(XContentBuilder builder, com.vividsolutions.jts.geom.Coordinate coordinate) throws java.io.IOException
java.io.IOException
protected 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
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getWriteableName()
NamedWriteable
getWriteableName
in interface NamedWriteable
public java.lang.String toString()
toString
in class java.lang.Object