Search in sources :

Example 16 with LineStringType

use of net.opengis.gml.x32.LineStringType in project ddf by codice.

the class WfsFilterDelegateTest method testLineStringLonLatOrder.

@Test
public void testLineStringLonLatOrder() {
    final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.INTERSECTS.getValue(), new LonLatCoordinateStrategy());
    final FilterType filter = delegate.intersects(Metacard.ANY_GEO, LINESTRING);
    assertThat(filter.getSpatialOps().getValue(), is(instanceOf(BinarySpatialOpType.class)));
    final BinarySpatialOpType binarySpatialOpType = (BinarySpatialOpType) filter.getSpatialOps().getValue();
    assertThat(binarySpatialOpType.getGeometry().getValue(), is(instanceOf(LineStringType.class)));
    final LineStringType lineStringType = (LineStringType) binarySpatialOpType.getGeometry().getValue();
    assertThat(lineStringType.getCoordinates().getValue(), is("30.0,10.0 10.0,30.0 50.0,40.0"));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) LineStringType(net.opengis.gml.v_3_1_1.LineStringType) Test(org.junit.Test)

Example 17 with LineStringType

use of net.opengis.gml.x32.LineStringType in project ddf by codice.

the class WfsFilterDelegateTest method testLineStringLatLonOrder.

@Test
public void testLineStringLatLonOrder() {
    final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.INTERSECTS.getValue(), new LatLonCoordinateStrategy());
    final FilterType filter = delegate.intersects(Metacard.ANY_GEO, LINESTRING);
    assertThat(filter.getSpatialOps().getValue(), is(instanceOf(BinarySpatialOpType.class)));
    final BinarySpatialOpType binarySpatialOpType = (BinarySpatialOpType) filter.getSpatialOps().getValue();
    assertThat(binarySpatialOpType.getGeometry().getValue(), is(instanceOf(LineStringType.class)));
    final LineStringType lineStringType = (LineStringType) binarySpatialOpType.getGeometry().getValue();
    assertThat(lineStringType.getCoordinates().getValue(), is("10.0,30.0 30.0,10.0 40.0,50.0"));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) LineStringType(net.opengis.gml.v_3_1_1.LineStringType) Test(org.junit.Test)

Aggregations

LineStringType (net.opengis.gml.v_3_2_1.LineStringType)5 LineStringType (ogc.schema.opengis.gml.v_2_1_2.LineStringType)5 MultiLineStringType (ogc.schema.opengis.gml.v_2_1_2.MultiLineStringType)5 Test (org.junit.Test)5 LineString (com.vividsolutions.jts.geom.LineString)4 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)4 LineString (org.locationtech.jts.geom.LineString)4 JAXBElement (javax.xml.bind.JAXBElement)3 LineStringType (net.opengis.gml.v_3_1_1.LineStringType)3 DirectPositionListType (net.opengis.gml.x32.DirectPositionListType)3 MultiLineString (org.locationtech.jts.geom.MultiLineString)3 MultiPoint (org.locationtech.jts.geom.MultiPoint)3 Point (org.locationtech.jts.geom.Point)3 BinarySpatialOpType (net.opengis.filter.v_1_1_0.BinarySpatialOpType)2 FilterType (net.opengis.filter.v_1_1_0.FilterType)2 LineStringDocument (net.opengis.gml.x32.LineStringDocument)2 LineStringType (net.opengis.gml.x32.LineStringType)2 Polygon (org.locationtech.jts.geom.Polygon)2 Iterator (java.util.Iterator)1 JAXBException (javax.xml.bind.JAXBException)1