use of org.geosdi.geoplatform.xml.gml.v311.EnvelopeType in project geo-platform by geosdi.
the class WFSGetFeatureRequestV110 method createEnvelope.
/**
* @param bbox
* @return {@link EnvelopeType}
*/
private EnvelopeType createEnvelope(BBox bbox) {
EnvelopeType envelope = new EnvelopeType();
DirectPositionType lower = new DirectPositionType();
lower.setValue(asList(bbox.getMinX(), bbox.getMinY()));
envelope.setLowerCorner(lower);
DirectPositionType upper = new DirectPositionType();
upper.setValue(asList(bbox.getMaxX(), bbox.getMaxY()));
envelope.setUpperCorner(upper);
return envelope;
}
use of org.geosdi.geoplatform.xml.gml.v311.EnvelopeType in project geo-platform by geosdi.
the class QueryRestrictionsBuilderTest method createFilterType.
/**
* @return {@link FilterType}
*/
private FilterType createFilterType() {
FilterType filter = new FilterType();
BBox bbox = new BBox(14.131237640976908, 36.56356461583572, 15.821758881211283, 37.143760728459014);
BBOXType bBoxType = new BBOXType();
PropertyNameType propertyNameType = new PropertyNameType();
propertyNameType.setContent(Arrays.asList("the_geom"));
bBoxType.setPropertyName(propertyNameType);
EnvelopeType envelope = new EnvelopeType();
DirectPositionType lower = new DirectPositionType();
lower.setValue(asList(bbox.getMinX(), bbox.getMinY()));
envelope.setLowerCorner(lower);
DirectPositionType upper = new DirectPositionType();
upper.setValue(asList(bbox.getMaxX(), bbox.getMaxY()));
envelope.setUpperCorner(upper);
envelope.setSrsName("EPSG:4326");
bBoxType.setEnvelope(new ObjectFactory().createEnvelope(envelope));
filter.setSpatialOps(new org.geosdi.geoplatform.xml.filter.v110.ObjectFactory().createBBOX(bBoxType));
return filter;
}
use of org.geosdi.geoplatform.xml.gml.v311.EnvelopeType in project ddf by codice.
the class WfsFilterDelegate method createEnvelope.
private JAXBElement<EnvelopeType> createEnvelope(Geometry geometry) {
EnvelopeType envelopeType = gml320ObjectFactory.createEnvelopeType();
envelopeType.setSrsName(GeospatialUtil.EPSG_4326_URN);
Envelope envelope = geometry.getEnvelopeInternal();
DirectPositionType lowerCorner = gml320ObjectFactory.createDirectPositionType();
lowerCorner.getValue().add(envelope.getMinX());
lowerCorner.getValue().add(envelope.getMinY());
envelopeType.setLowerCorner(lowerCorner);
DirectPositionType upperCorner = gml320ObjectFactory.createDirectPositionType();
upperCorner.getValue().add(envelope.getMaxX());
upperCorner.getValue().add(envelope.getMaxY());
envelopeType.setUpperCorner(upperCorner);
return gml320ObjectFactory.createEnvelope(envelopeType);
}
use of org.geosdi.geoplatform.xml.gml.v311.EnvelopeType in project ddf by codice.
the class WfsFilterDelegateTest method testBoundingBoxLatLonOrder.
@Test
public void testBoundingBoxLatLonOrder() {
final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.BBOX.getValue(), new LatLonCoordinateStrategy());
final FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
assertThat(filter.getSpatialOps().getValue(), is(instanceOf(BBOXType.class)));
final BBOXType bboxType = (BBOXType) filter.getSpatialOps().getValue();
final EnvelopeType envelope = bboxType.getEnvelope().getValue();
final DirectPositionType lowerCorner = envelope.getLowerCorner();
assertThat("The bounding box's lower corner was null.", lowerCorner, is(notNullValue()));
assertThat(lowerCorner.getValue(), is(asList(-10.0, 10.0)));
final DirectPositionType upperCorner = envelope.getUpperCorner();
assertThat("The bounding box's upper corner was null.", upperCorner, is(notNullValue()));
assertThat(upperCorner.getValue(), is(asList(30.0, 40.0)));
}
use of org.geosdi.geoplatform.xml.gml.v311.EnvelopeType in project ddf by codice.
the class WfsFilterDelegateTest method testBoundingBoxLonLatOrder.
@Test
public void testBoundingBoxLonLatOrder() {
final WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.BBOX.getValue(), new LonLatCoordinateStrategy());
final FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
assertThat(filter.getSpatialOps().getValue(), is(instanceOf(BBOXType.class)));
final BBOXType bboxType = (BBOXType) filter.getSpatialOps().getValue();
final EnvelopeType envelope = bboxType.getEnvelope().getValue();
final DirectPositionType lowerCorner = envelope.getLowerCorner();
assertThat("The bounding box's lower corner was null.", lowerCorner, is(notNullValue()));
assertThat(lowerCorner.getValue(), is(asList(10.0, -10.0)));
final DirectPositionType upperCorner = envelope.getUpperCorner();
assertThat("The bounding box's upper corner was null.", upperCorner, is(notNullValue()));
assertThat(upperCorner.getValue(), is(asList(40.0, 30.0)));
}
Aggregations