use of org.n52.io.crs.BoundingBox in project series-rest-api by 52North.
the class IoParametersTest method when_jsonBbox_then_parsingSpatialFilter.
@Test
public void when_jsonBbox_then_parsingSpatialFilter() throws ParseException {
Map<String, String> map = Collections.singletonMap("bbox", "{\"ll\":{\"type\":\"Point\",\"coordinates\":[6.7,51.7]},\"ur\":{\"type\":\"Point\",\"coordinates\":[7.9,51.9]}}");
IoParameters parameters = createFromSingleValueMap(map);
BoundingBox actual = parameters.getSpatialFilter();
WKTReader wktReader = new WKTReader();
Geometry ll = wktReader.read("POINT (6.7 51.7)");
Geometry ur = wktReader.read("POINT(7.9 51.9)");
Assert.assertTrue(actual.getLowerLeft().equals(ll));
Assert.assertTrue(actual.getUpperRight().equals(ur));
}
Aggregations