Search in sources :

Example 6 with MultiPolygonType

use of net.opengis.gml.v_3_1_1.MultiPolygonType in project ddf by codice.

the class WfsFilterDelegateTest method testMultiPolygonLonLatOrder.

@Test
public void testMultiPolygonLonLatOrder() {
    final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.INTERSECTS.getValue(), new LonLatCoordinateStrategy());
    final FilterType filter = delegate.intersects(Metacard.ANY_GEO, MULTIPOLYGON);
    assertThat(filter.getSpatialOps().getValue(), is(instanceOf(BinarySpatialOpType.class)));
    final BinarySpatialOpType binarySpatialOpType = (BinarySpatialOpType) filter.getSpatialOps().getValue();
    assertThat(binarySpatialOpType.getGeometry().getValue(), is(instanceOf(MultiPolygonType.class)));
    final MultiPolygonType multiPolygonType = (MultiPolygonType) binarySpatialOpType.getGeometry().getValue();
    assertThat(multiPolygonType.getPolygonMember().size(), is(2));
    final LinearRingType firstLinearRing = (LinearRingType) multiPolygonType.getPolygonMember().get(0).getPolygon().getExterior().getValue().getRing().getValue();
    assertThat(firstLinearRing.getCoordinates().getValue(), is("30.0,20.0 10.0,40.0 45.0,40.0 30.0,20.0"));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) LinearRingType(net.opengis.gml.v_3_1_1.LinearRingType) BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) MultiPolygonType(net.opengis.gml.v_3_1_1.MultiPolygonType) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 LineString (com.vividsolutions.jts.geom.LineString)3 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)3 MultiPolygonType (net.opengis.gml.v_3_1_1.MultiPolygonType)3 MultiPolygonType (ogc.schema.opengis.gml.v_2_1_2.MultiPolygonType)3 JAXBElement (javax.xml.bind.JAXBElement)2 BinarySpatialOpType (net.opengis.filter.v_1_1_0.BinarySpatialOpType)2 FilterType (net.opengis.filter.v_1_1_0.FilterType)2 LinearRingType (net.opengis.gml.v_3_1_1.LinearRingType)2 JAXBException (javax.xml.bind.JAXBException)1 PolygonPropertyType (net.opengis.gml.v_3_1_1.PolygonPropertyType)1 PolygonType (net.opengis.gml.v_3_1_1.PolygonType)1 GeometryAssociationType (ogc.schema.opengis.gml.v_2_1_2.GeometryAssociationType)1 MultiLineStringType (ogc.schema.opengis.gml.v_2_1_2.MultiLineStringType)1 PolygonMemberType (ogc.schema.opengis.gml.v_2_1_2.PolygonMemberType)1 Diff (org.custommonkey.xmlunit.Diff)1 Geometry (org.locationtech.jts.geom.Geometry)1 Point (org.locationtech.jts.geom.Point)1