Package org.elasticsearch.common.geo
Class GeometryParser
java.lang.Object
org.elasticsearch.common.geo.GeometryParser
An utility class with to read geometries from a XContentParser or generic object.
-
Constructor Summary
ConstructorDescriptionGeometryParser(boolean rightOrientation, boolean coerce, boolean ignoreZValue)
-
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.geometry.Geometry
parse(org.elasticsearch.common.xcontent.XContentParser parser)
Parses supplied XContent into Geometryorg.elasticsearch.geometry.Geometry
parseGeometry(Object value)
Parses the value as aGeometry
.
-
Constructor Details
-
GeometryParser
public GeometryParser(boolean rightOrientation, boolean coerce, boolean ignoreZValue)
-
-
Method Details
-
parse
public org.elasticsearch.geometry.Geometry parse(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException, ParseExceptionParses supplied XContent into Geometry- Throws:
IOException
ParseException
-
parseGeometry
public org.elasticsearch.geometry.Geometry parseGeometry(Object value) throws ElasticsearchParseExceptionParses the value as aGeometry
. The following types of values are supported:Object: has to contain either lat and lon or geohash fields
String: expected to be in "latitude, longitude" format, a geohash or WKT
Array: two or more elements, the first element is longitude, the second is latitude, the rest is ignored if ignoreZValue is true
Json structure: valid geojson definition
- Throws:
ElasticsearchParseException
-