public abstract class ShapeBuilder extends Object implements ToXContent
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.GeoShapeType s that can be handled |
static class |
ShapeBuilder.Orientation |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoIndexJtsGeometry |
protected boolean |
autoValidateJtsGeometry |
static double |
DATELINE |
static com.vividsolutions.jts.geom.GeometryFactory |
FACTORY |
static String |
FIELD_COORDINATES |
static String |
FIELD_GEOMETRIES |
static String |
FIELD_ORIENTATION |
static String |
FIELD_TYPE |
protected static org.elasticsearch.common.geo.builders.ShapeBuilder.IntersectionOrder |
INTERSECTION_ORDER |
protected static ESLogger |
LOGGER |
protected boolean |
multiPolygonMayOverlap
It's possible that some geometries in a MULTI* shape might overlap.
|
protected ShapeBuilder.Orientation |
orientation |
static com.spatial4j.core.context.jts.JtsSpatialContext |
SPATIAL_CONTEXT |
protected boolean |
wrapdateline
We're expecting some geometries might cross the dateline.
|
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
ShapeBuilder() |
protected |
ShapeBuilder(ShapeBuilder.Orientation orientation) |
Modifier and Type | Method and Description |
---|---|
abstract com.spatial4j.core.shape.Shape |
build()
Create a new Shape from this builder.
|
protected static com.vividsolutions.jts.geom.Coordinate |
coordinate(double longitude,
double latitude) |
protected static boolean |
debugEnabled() |
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 com.spatial4j.core.shape.jts.JtsGeometry |
jtsGeometry(com.vividsolutions.jts.geom.Geometry geom) |
static CircleBuilder |
newCircleBuilder()
create a new Circle
|
static EnvelopeBuilder |
newEnvelope()
create a new rectangle
|
static EnvelopeBuilder |
newEnvelope(ShapeBuilder.Orientation orientation)
create a new rectangle
|
static GeometryCollectionBuilder |
newGeometryCollection()
Create a new GeometryCollection
|
static GeometryCollectionBuilder |
newGeometryCollection(ShapeBuilder.Orientation orientation)
Create a new GeometryCollection
|
static LineStringBuilder |
newLineString()
Create a new lineString
|
static MultiLineStringBuilder |
newMultiLinestring()
Create a new Collection of lineStrings
|
static MultiPointBuilder |
newMultiPoint()
Create a new set of points
|
static MultiPolygonBuilder |
newMultiPolygon()
Create a new Collection of polygons
|
static MultiPolygonBuilder |
newMultiPolygon(ShapeBuilder.Orientation orientation)
Create a new Collection of polygons
|
static PointBuilder |
newPoint(com.vividsolutions.jts.geom.Coordinate coordinate)
Create a new
PointBuilder from a Coordinate |
static PointBuilder |
newPoint(double longitude,
double latitude)
Create a new point
|
static PolygonBuilder |
newPolygon()
Create a new Polygon
|
static PolygonBuilder |
newPolygon(ShapeBuilder.Orientation orientation)
Create a new Polygon
|
static ShapeBuilder.Orientation |
orientationFromString(String orientation) |
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 |
shift(com.vividsolutions.jts.geom.Coordinate coordinate,
double dateline) |
String |
toString() |
protected static XContentBuilder |
toXContent(XContentBuilder builder,
com.vividsolutions.jts.geom.Coordinate coordinate) |
abstract ShapeBuilder.GeoShapeType |
type()
get the shapes type
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toXContent
protected static final ESLogger LOGGER
public static final double DATELINE
public static final com.spatial4j.core.context.jts.JtsSpatialContext SPATIAL_CONTEXT
public static final com.vividsolutions.jts.geom.GeometryFactory FACTORY
protected final boolean wrapdateline
protected final boolean multiPolygonMayOverlap
protected final boolean autoValidateJtsGeometry
JtsGeometry.validate()
,
Constant Field Valuesprotected final boolean autoIndexJtsGeometry
JtsGeometry.index()
,
Constant Field Valuesprotected ShapeBuilder.Orientation orientation
protected static final org.elasticsearch.common.geo.builders.ShapeBuilder.IntersectionOrder INTERSECTION_ORDER
public static final String FIELD_TYPE
public static final String FIELD_COORDINATES
public static final String FIELD_GEOMETRIES
public static final String FIELD_ORIENTATION
protected ShapeBuilder()
protected ShapeBuilder(ShapeBuilder.Orientation orientation)
protected static com.vividsolutions.jts.geom.Coordinate coordinate(double longitude, double latitude)
protected com.spatial4j.core.shape.jts.JtsGeometry jtsGeometry(com.vividsolutions.jts.geom.Geometry geom)
public static PointBuilder newPoint(double longitude, double latitude)
longitude
- longitude of the pointlatitude
- latitude of the pointPointBuilder
public static PointBuilder newPoint(com.vividsolutions.jts.geom.Coordinate coordinate)
PointBuilder
from a Coordinate
coordinate
- coordinate defining the position of the pointPointBuilder
public static MultiPointBuilder newMultiPoint()
MultiPointBuilder
public static LineStringBuilder newLineString()
LineStringBuilder
public static MultiLineStringBuilder newMultiLinestring()
MultiLineStringBuilder
public static PolygonBuilder newPolygon()
PointBuilder
public static PolygonBuilder newPolygon(ShapeBuilder.Orientation orientation)
PointBuilder
public static MultiPolygonBuilder newMultiPolygon()
MultiPolygonBuilder
public static MultiPolygonBuilder newMultiPolygon(ShapeBuilder.Orientation orientation)
MultiPolygonBuilder
public static GeometryCollectionBuilder newGeometryCollection()
GeometryCollectionBuilder
public static GeometryCollectionBuilder newGeometryCollection(ShapeBuilder.Orientation orientation)
GeometryCollectionBuilder
public static CircleBuilder newCircleBuilder()
CircleBuilder
public static EnvelopeBuilder newEnvelope()
EnvelopeBuilder
public static EnvelopeBuilder newEnvelope(ShapeBuilder.Orientation orientation)
EnvelopeBuilder
public abstract com.spatial4j.core.shape.Shape build()
Shape
defined by the builderpublic static ShapeBuilder parse(XContentParser parser) throws IOException
ShapeBuilder
from XContent
parser
- parser to read the GeoShape fromShapeBuilder
read from the parser or null
if the parsers current token has been null
IOException
- if the input could not be readpublic static ShapeBuilder parse(XContentParser parser, GeoShapeFieldMapper geoDocMapper) throws IOException
ShapeBuilder
from XContent
parser
- 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 null
IOException
- if the input could not be readprotected static XContentBuilder toXContent(XContentBuilder builder, com.vividsolutions.jts.geom.Coordinate coordinate) throws IOException
IOException
public static ShapeBuilder.Orientation orientationFromString(String orientation)
protected 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.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 static final boolean debugEnabled()
Copyright © 2009–2016. All rights reserved.