Search in sources :

Example 1 with ShapeCollection

use of org.locationtech.spatial4j.shape.ShapeCollection in project elasticsearch by elastic.

the class GeoJSONShapeParserTests method testParseMultiPoint.

public void testParseMultiPoint() throws IOException {
    XContentBuilder multiPointGeoJson = XContentFactory.jsonBuilder().startObject().field("type", "MultiPoint").startArray("coordinates").startArray().value(100.0).value(0.0).endArray().startArray().value(101.0).value(1.0).endArray().endArray().endObject();
    ShapeCollection expected = shapeCollection(SPATIAL_CONTEXT.makePoint(100, 0), SPATIAL_CONTEXT.makePoint(101, 1.0));
    assertGeometryEquals(expected, multiPointGeoJson);
}
Also used : ShapeCollection(org.locationtech.spatial4j.shape.ShapeCollection) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder)

Aggregations

XContentBuilder (org.elasticsearch.common.xcontent.XContentBuilder)1 ShapeCollection (org.locationtech.spatial4j.shape.ShapeCollection)1