use of org.n52.shetland.ogc.sos.request.GetObservationRequest in project arctic-sea by 52North.
the class GetObservationRequestDecoderTest method hasSpatialFilter.
@Test
public void hasSpatialFilter() throws IOException, DecodingException {
final GetObservationRequest req = loadSingle();
assertThat(req.getSpatialFilter(), is(notNullValue()));
assertThat(req.getSpatialFilter().getOperator(), is(SpatialOperator.Equals));
assertThat(req.getSpatialFilter().getValueReference(), is("om:featureOfInterest/sams:SF_SpatialSamplingFeature/sams:shape"));
assertThat(req.getSpatialFilter().getGeometry(), is(notNullValue()));
assertThat(req.getSpatialFilter().getGeometry(), is(instanceOf(EnvelopeOrGeometry.class)));
assertThat(req.getSpatialFilter().getGeometry().isGeometry(), is(true));
assertThat(req.getSpatialFilter().getGeometry().getGeometry().get().getSRID(), is(4326));
assertThat(req.getSpatialFilter().getGeometry().getGeometry().get().getCoordinate().x, is(51.0));
assertThat(req.getSpatialFilter().getGeometry().getGeometry().get().getCoordinate().y, is(8.0));
assertThat(Double.isNaN(req.getSpatialFilter().getGeometry().getGeometry().get().getCoordinate().z), is(true));
}
use of org.n52.shetland.ogc.sos.request.GetObservationRequest in project arctic-sea by 52North.
the class GetObservationRequestDecoderTest method hasProcedure.
@Test
public void hasProcedure() throws IOException, DecodingException {
final GetObservationRequest req = loadSingle();
assertThat(req.getProcedures(), is(notNullValue()));
assertThat(req.getProcedures(), hasSize(1));
assertThat(req.getProcedures().get(0), is(notNullValue()));
assertThat(req.getProcedures().get(0), is(equalTo("procedure1")));
}
use of org.n52.shetland.ogc.sos.request.GetObservationRequest in project arctic-sea by 52North.
the class GetObservationRequestDecoderTest method hasFeaturesOfInterest.
@Test
public void hasFeaturesOfInterest() throws IOException, DecodingException {
final GetObservationRequest req = loadMultiple();
assertThat(req.getFeatureIdentifiers(), is(notNullValue()));
assertThat(req.getFeatureIdentifiers(), hasSize(2));
assertThat(req.getFeatureIdentifiers().get(0), is(notNullValue()));
assertThat(req.getFeatureIdentifiers().get(0), is(equalTo("featureOfInterest1")));
assertThat(req.getFeatureIdentifiers().get(1), is(notNullValue()));
assertThat(req.getFeatureIdentifiers().get(1), is(equalTo("featureOfInterest2")));
}
use of org.n52.shetland.ogc.sos.request.GetObservationRequest in project arctic-sea by 52North.
the class GetObservationRequestDecoderTest method loadMultiple.
protected GetObservationRequest loadMultiple() throws DecodingException, IOException {
final JsonNode json = JsonLoader.fromResource("/examples/sos/GetObservationRequest-multiple.json");
final GetObservationRequest req = decoder.decodeJSON(json, true);
assertThat(req, is(notNullValue()));
return req;
}
use of org.n52.shetland.ogc.sos.request.GetObservationRequest in project arctic-sea by 52North.
the class GetObservationRequestDecoderTest method hasNoTemporalFilters.
@Test
public void hasNoTemporalFilters() throws IOException, DecodingException {
final GetObservationRequest req = loadNoFilters();
assertThat(req.getTemporalFilters(), is(notNullValue()));
assertThat(req.getTemporalFilters(), hasSize(0));
}
Aggregations