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"));
}
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");
}
}
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"));
}
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);
}
}
}
Aggregations