java.lang.Object
org.elasticsearch.common.geo.GeometryParser
An utility class with to read geometries from a XContentParser or generic object.
-
Constructor Summary
ConstructorsConstructorDescriptionGeometryParser(boolean rightOrientation, boolean coerce, boolean ignoreZValue) -
Method Summary
Modifier and TypeMethodDescriptionparse(XContentParser parser) Parses supplied XContent into GeometryparseGeometry(Object value) Parses the value as aGeometry.
-
Constructor Details
-
GeometryParser
public GeometryParser(boolean rightOrientation, boolean coerce, boolean ignoreZValue)
-
-
Method Details
-
parse
Parses supplied XContent into Geometry- Throws:
IOExceptionParseException
-
parseGeometry
Parses 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
-