Search in sources :

Example 16 with GetObservationRequest

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));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Example 17 with GetObservationRequest

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")));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Example 18 with GetObservationRequest

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")));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Example 19 with GetObservationRequest

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;
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Example 20 with GetObservationRequest

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));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Aggregations

GetObservationRequest (org.n52.shetland.ogc.sos.request.GetObservationRequest)22 Test (org.junit.Test)15 JsonNode (com.fasterxml.jackson.databind.JsonNode)4 OwsServiceCommunicationObject (org.n52.shetland.ogc.ows.service.OwsServiceCommunicationObject)3 GetObservationDocument (net.opengis.sos.x20.GetObservationDocument)2 DateTime (org.joda.time.DateTime)2 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)2 DecodingException (org.n52.svalbard.decode.exception.DecodingException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 TRUE (java.lang.Boolean.TRUE)1 Arrays (java.util.Arrays)1 Set (java.util.Set)1 GetFeatureOfInterest (net.opengis.sos.x10.GetFeatureOfInterestDocument.GetFeatureOfInterest)1 GetObservation (net.opengis.sos.x10.GetObservationDocument.GetObservation)1 FeatureOfInterest (net.opengis.sos.x10.GetObservationDocument.GetObservation.FeatureOfInterest)1 GetObservationType (net.opengis.sos.x20.GetObservationType)1 InsertResultTemplateDocument (net.opengis.sos.x20.InsertResultTemplateDocument)1 XmlException (org.apache.xmlbeans.XmlException)1 XmlObject (org.apache.xmlbeans.XmlObject)1 XmlOptions (org.apache.xmlbeans.XmlOptions)1