public abstract class ShapeBuilder extends java.lang.Object implements NamedWriteable, ToXContentObject
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ShapeBuilder.CoordinateNode
Node used to represent a tree of coordinates.
|
protected static class |
ShapeBuilder.Edge
This helper class implements a linked list for
Coordinate. |
static class |
ShapeBuilder.GeoShapeType
Enumeration that lists all
ShapeBuilder.GeoShapeTypes that can be handled |
static class |
ShapeBuilder.Orientation |
Writeable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
AUTO_INDEX_JTS_GEOMETRY |
protected static boolean |
AUTO_VALIDATE_JTS_GEOMETRY |
static double |
DATELINE |
static com.vividsolutions.jts.geom.GeometryFactory |
FACTORY |
static java.lang.String |
FIELD_COORDINATES |
static java.lang.String |
FIELD_GEOMETRIES |
static java.lang.String |
FIELD_ORIENTATION |
static java.lang.String |
FIELD_TYPE |
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 and Description |
|---|---|
protected |
ShapeBuilder() |
| Modifier and Type | Method and Description |
|---|---|
abstract org.locationtech.spatial4j.shape.Shape |
build()
Create a new Shape from this builder.
|
protected static boolean |
debugEnabled() |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
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)
Create a new
ShapeBuilder from XContent |
static ShapeBuilder |
parse(XContentParser parser,
GeoShapeFieldMapper geoDocMapper)
Create a new
ShapeBuilder from XContent |
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() |
protected static XContentBuilder |
toXContent(XContentBuilder builder,
com.vividsolutions.jts.geom.Coordinate coordinate) |
abstract ShapeBuilder.GeoShapeType |
type()
get the shapes type
|
protected static void |
writeCoordinateTo(com.vividsolutions.jts.geom.Coordinate coordinate,
StreamOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisFragmenttoXContentprotected static final org.apache.logging.log4j.Logger LOGGER
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
public static final java.lang.String FIELD_TYPE
public static final java.lang.String FIELD_COORDINATES
public static final java.lang.String FIELD_GEOMETRIES
public static final java.lang.String FIELD_ORIENTATION
protected org.locationtech.spatial4j.shape.jts.JtsGeometry jtsGeometry(com.vividsolutions.jts.geom.Geometry geom)
public abstract org.locationtech.spatial4j.shape.Shape build()
Shape defined by the builderpublic static ShapeBuilder parse(XContentParser parser) throws java.io.IOException
ShapeBuilder from XContentparser - parser to read the GeoShape fromShapeBuilder read from the parser or null
if the parsers current token has been nulljava.io.IOException - if the input could not be readpublic static ShapeBuilder parse(XContentParser parser, GeoShapeFieldMapper geoDocMapper) throws java.io.IOException
ShapeBuilder from XContentparser - parser to read the GeoShape fromgeoDocMapper - document field mapper reference required for spatial parameters relevant
to the shape construction process (e.g., orientation)
todo: refactor to place build specific parameters in the SpatialContextShapeBuilder read from the parser or null
if the parsers current token has been nulljava.io.IOException - if the input could not be readprotected static XContentBuilder toXContent(XContentBuilder builder, com.vividsolutions.jts.geom.Coordinate coordinate) throws java.io.IOException
java.io.IOExceptionprotected static void writeCoordinateTo(com.vividsolutions.jts.geom.Coordinate coordinate,
StreamOutput out)
throws java.io.IOException
java.io.IOExceptionprotected static com.vividsolutions.jts.geom.Coordinate readFromStream(StreamInput in) throws java.io.IOException
java.io.IOExceptionprotected static com.vividsolutions.jts.geom.Coordinate shift(com.vividsolutions.jts.geom.Coordinate coordinate,
double dateline)
public abstract ShapeBuilder.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.NaNprotected static int intersections(double dateline,
ShapeBuilder.Edge[] edges)
dateline - x-coordinate of the datelineedges - set of edges that may intersect with the datelineprotected static final boolean debugEnabled()
public java.lang.String getWriteableName()
NamedWriteablegetWriteableName in interface NamedWriteablepublic java.lang.String toString()
toString in class java.lang.Object