org.elasticsearch.common.geo
Class GeoJSONShapeParser
java.lang.Object
org.elasticsearch.common.geo.GeoJSONShapeParser
public class GeoJSONShapeParser
- extends Object
Parsers which supports reading Shape
s in GeoJSON format from a given
XContentParser
.
An example of the format used for polygons:
{
"type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
[100.0, 1.0], [100.0, 0.0] ]
]
}
Note, currently MultiPolygon and GeometryCollections are not supported
Method Summary |
static com.spatial4j.core.shape.Shape |
parse(XContentParser parser)
Parses the current object from the given XContentParser , creating
the Shape representation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parse
public static com.spatial4j.core.shape.Shape parse(XContentParser parser)
throws IOException
- Parses the current object from the given
XContentParser
, creating
the Shape
representation
- Parameters:
parser
- Parser that will be read from
- Returns:
- Shape representation of the geojson defined Shape
- Throws:
IOException
- Thrown if an error occurs while reading from the XContentParser
Copyright © 2009-2012. All Rights Reserved.