Search in sources :

Example 16 with PointType

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

the class WfsFilterDelegateTest method testPointLonLatOrder.

@Test
public void testPointLonLatOrder() {
    final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.DWITHIN.getValue(), new LonLatCoordinateStrategy());
    final FilterType filter = delegate.dwithin(Metacard.ANY_GEO, POINT, DISTANCE);
    assertThat(filter.getSpatialOps().getValue(), is(instanceOf(DistanceBufferType.class)));
    final DistanceBufferType distanceBufferType = (DistanceBufferType) filter.getSpatialOps().getValue();
    assertThat(distanceBufferType.getGeometry().getValue(), is(instanceOf(PointType.class)));
    final PointType pointType = (PointType) distanceBufferType.getGeometry().getValue();
    assertThat(pointType.getCoordinates().getValue(), is("30.0,-10.0"));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) PointType(net.opengis.gml.v_3_1_1.PointType) DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) Test(org.junit.Test)

Example 17 with PointType

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

the class WfsFilterDelegate method createPoint.

private JAXBElement<AbstractGeometryType> createPoint(String wkt) {
    Coordinate[] coordinates = getCoordinatesFromWkt(wkt);
    if (coordinates != null && coordinates.length > 0) {
        CoordinatesType coordinatesType = new CoordinatesType();
        String coordinateString = coordinateStrategy.toString(coordinates[0]);
        coordinatesType.setValue(coordinateString);
        PointType point = new PointType();
        point.setCoordinates(coordinatesType);
        return gmlObjectFactory.createGeometry(point);
    } else {
        throw new IllegalArgumentException("Unable to parse Point coordinates from WKT String");
    }
}
Also used : Coordinate(org.locationtech.jts.geom.Coordinate) PointType(net.opengis.gml.v_3_1_1.PointType) LineString(org.locationtech.jts.geom.LineString) CoordinatesType(net.opengis.gml.v_3_1_1.CoordinatesType)

Example 18 with PointType

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

the class WfsFilterDelegateTest method testPointLatLonOrder.

@Test
public void testPointLatLonOrder() {
    final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.DWITHIN.getValue(), new LatLonCoordinateStrategy());
    final FilterType filter = delegate.dwithin(Metacard.ANY_GEO, POINT, DISTANCE);
    assertThat(filter.getSpatialOps().getValue(), is(instanceOf(DistanceBufferType.class)));
    final DistanceBufferType distanceBufferType = (DistanceBufferType) filter.getSpatialOps().getValue();
    assertThat(distanceBufferType.getGeometry().getValue(), is(instanceOf(PointType.class)));
    final PointType pointType = (PointType) distanceBufferType.getGeometry().getValue();
    assertThat(pointType.getCoordinates().getValue(), is("-10.0,30.0"));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) PointType(net.opengis.gml.v_3_1_1.PointType) DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) Test(org.junit.Test)

Example 19 with PointType

use of net.opengis.gml.v_3_1_1.PointType in project arctic-sea by 52North.

the class GmlEncoderv321 method createMultiPointFromJtsGeometry.

private void createMultiPointFromJtsGeometry(MultiPoint geom, MultiPointType xbMultiPoint, String id) throws EncodingException {
    for (int i = 0; i < geom.getNumGeometries(); i++) {
        Geometry geometry = geom.getGeometryN(i);
        if (geometry instanceof Point) {
            PointType pt = xbMultiPoint.addNewPointMember().addNewPoint();
            pt.setId(id + "_" + i);
            createPointFromJtsGeometry((Point) geometry, pt);
        }
    }
}
Also used : EnvelopeOrGeometry(org.n52.shetland.util.EnvelopeOrGeometry) Geometry(org.locationtech.jts.geom.Geometry) AbstractGeometry(org.n52.shetland.ogc.gml.AbstractGeometry) MultiPointType(net.opengis.gml.x32.MultiPointType) PointType(net.opengis.gml.x32.PointType) MultiPoint(org.locationtech.jts.geom.MultiPoint) Point(org.locationtech.jts.geom.Point) MultiPoint(org.locationtech.jts.geom.MultiPoint) Point(org.locationtech.jts.geom.Point)

Aggregations

PointType (net.opengis.gml.v_3_1_1.PointType)9 Test (org.junit.Test)7 DistanceBufferType (net.opengis.filter.v_1_1_0.DistanceBufferType)4 DirectPositionType (net.opengis.gml.v_3_1_1.DirectPositionType)4 MultiPointType (ogc.schema.opengis.gml.v_2_1_2.MultiPointType)4 PointType (ogc.schema.opengis.gml.v_2_1_2.PointType)4 LineString (com.vividsolutions.jts.geom.LineString)3 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)3 ArrayList (java.util.ArrayList)3 JAXBElement (javax.xml.bind.JAXBElement)3 AnyValueType (net.opengis.cat.wrs.v_1_0_2.AnyValueType)3 PointType (net.opengis.gml.v_3_2_1.PointType)3 Query (ddf.catalog.operation.Query)2 QueryImpl (ddf.catalog.operation.impl.QueryImpl)2 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ValueListType (net.opengis.cat.wrs.v_1_0_2.ValueListType)2 FilterType (net.opengis.filter.v_1_1_0.FilterType)2 EnvelopeType (net.opengis.gml.v_3_1_1.EnvelopeType)2