Package org.elasticsearch.common.geo
Interface GeometryFormat<ParsedFormat>
- All Known Implementing Classes:
GeoJsonGeometryFormat
,WKTGeometryFormat
public interface GeometryFormat<ParsedFormat>
Geometry serializer/deserializer
-
Method Summary
Modifier and Type Method Description ParsedFormat
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
Parser JSON representation of a geometryjava.lang.String
name()
The name of the format, for example 'wkt'.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(ParsedFormat geometry, org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Serializes the geometry into its JSON representationjava.lang.Object
toXContentAsObject(ParsedFormat geometry)
Serializes the geometry into a standard Java object.
-
Method Details
-
name
java.lang.String name()The name of the format, for example 'wkt'. -
fromXContent
ParsedFormat fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException, java.text.ParseExceptionParser JSON representation of a geometry- Throws:
java.io.IOException
java.text.ParseException
-
toXContent
org.elasticsearch.common.xcontent.XContentBuilder toXContent(ParsedFormat geometry, org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOExceptionSerializes the geometry into its JSON representation- Throws:
java.io.IOException
-
toXContentAsObject
Serializes the geometry into a standard Java object. For example, the GeoJson format returns the geometry as a map, while WKT returns a string.
-