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.GeoShapeTypes 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, waittoXContentprotected 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 pointPointBuilderpublic static PointBuilder newPoint(com.vividsolutions.jts.geom.Coordinate coordinate)
PointBuilder from a Coordinatecoordinate - coordinate defining the position of the pointPointBuilderpublic static MultiPointBuilder newMultiPoint()
MultiPointBuilderpublic static LineStringBuilder newLineString()
LineStringBuilderpublic static MultiLineStringBuilder newMultiLinestring()
MultiLineStringBuilderpublic static PolygonBuilder newPolygon()
PointBuilderpublic static PolygonBuilder newPolygon(ShapeBuilder.Orientation orientation)
PointBuilderpublic static MultiPolygonBuilder newMultiPolygon()
MultiPolygonBuilderpublic static MultiPolygonBuilder newMultiPolygon(ShapeBuilder.Orientation orientation)
MultiPolygonBuilderpublic static GeometryCollectionBuilder newGeometryCollection()
GeometryCollectionBuilderpublic static GeometryCollectionBuilder newGeometryCollection(ShapeBuilder.Orientation orientation)
GeometryCollectionBuilderpublic static CircleBuilder newCircleBuilder()
CircleBuilderpublic static EnvelopeBuilder newEnvelope()
EnvelopeBuilderpublic static EnvelopeBuilder newEnvelope(ShapeBuilder.Orientation orientation)
EnvelopeBuilderpublic abstract com.spatial4j.core.shape.Shape build()
Shape defined by the builderpublic static ShapeBuilder parse(XContentParser parser) throws IOException
ShapeBuilder from XContentparser - parser to read the GeoShape fromShapeBuilder read from the parser or null
if the parsers current token has been nullIOException - if the input could not be readpublic static ShapeBuilder parse(XContentParser parser, GeoShapeFieldMapper geoDocMapper) throws 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 nullIOException - if the input could not be readprotected static XContentBuilder toXContent(XContentBuilder builder, com.vividsolutions.jts.geom.Coordinate coordinate) throws IOException
IOExceptionpublic 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.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()
Copyright © 2009–2017. All rights reserved.