GetObservation

Introduction

The GetObservation operation is designed to query a service to retrieve observation data structured according to the Observation and Measurement specification. Upon receiving a GetObservation request, a SOS shall either satisfy the request or return an exception report. (SOS-Spec, OGC 06-009r6)

The current version of the SOS supports HTTP POST requests as well as HTTP GET requests for OGC SOS 1.0.0 GetObservation operation.

Examples HTTP POST

  • basic (with all mandatory parameters):
<?xml version="1.0" encoding="UTF-8"?>
<GetObservation xmlns="http://www.opengis.net/sos/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:om="http://www.opengis.net/om/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sos/1.0
http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd" service="SOS" version="1.0.0" srsName="urn:ogc:def:crs:EPSG:4326">
   <offering>GAUGE_HEIGHT</offering>
   <observedProperty>urn:ogc:def:phenomenon:OGC:1.0.30:waterlevel</observedProperty>
   <responseFormat>text/xml;subtype=&quot;om/1.0.0&quot;</responseFormat>
</GetObservation>

  • allParameters:
<?xml version="1.0" encoding="UTF-8"?>
<GetObservation xmlns="http://www.opengis.net/sos/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:om="http://www.opengis.net/om/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sos/1.0
http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd" service="SOS" version="1.0.0" srsName="urn:ogc:def:crs:EPSG:4326">
   <offering>GAUGE_HEIGHT</offering>
   <eventTime>
      <ogc:TM_During>
         <ogc:PropertyName>urn:ogc:data:time:iso8601</ogc:PropertyName>
         <gml:TimePeriod>
            <gml:beginPosition>2008-03-01T17:44:15+00</gml:beginPosition>
            <gml:endPosition>2008-05-01T17:44:15+00</gml:endPosition>
         </gml:TimePeriod>
      </ogc:TM_During>
   </eventTime>
   <procedure>urn:ogc:object:feature:Sensor:IFGI:ifgi-sensor-1</procedure>
   <observedProperty>urn:ogc:def:phenomenon:OGC:1.0.30:waterlevel</observedProperty>
   <featureOfInterest>
      <ogc:BBOX>
         <ogc:PropertyName>urn:ogc:data:location</ogc:PropertyName>
         <gml:Envelope srsName="urn:ogc:def:crs:EPSG:4326">
            <gml:lowerCorner>7.0 50.0</gml:lowerCorner>
            <gml:upperCorner>10.0 53.0</gml:upperCorner>
         </gml:Envelope>
      </ogc:BBOX>
   </featureOfInterest>
   <result>
      <ogc:PropertyIsGreaterThan>
         <ogc:PropertyName>urn:ogc:def:phenomenon:OGC:1.0.30:waterlevel</ogc:PropertyName>
         <ogc:Literal>5</ogc:Literal>
      </ogc:PropertyIsGreaterThan>
   </result>
   <responseFormat>text/xml;subtype=&quot;om/1.0.0&quot;</responseFormat>
   <resultModel>Measurement</resultModel>
   <responseMode>inline</responseMode>
</GetObservation>

For more information about the supportet filters look at SensorObservationService main page or at the SOS specification.

Examples HTTP GET

The following parameters are supported:

Parameter Name Definition Multiplicity and Use of the Parameter
request operation name getObservation One (mandatory)
service service type identifier SOS One (mandatory)
version specification version of the SOS accepted by client 1.0.0 One (mandatory)
offering specifies the offering URI advertised in the GetCapabilities document anyURI One (mandatory)
observedProperty comma-separated URIs, specifying the phenomena for which observations are requested anyURI One or Many (mandatory)
procedure system for which the observations are requested anyURI Zero or Many (optional)
featureOfInterest comma-separated URIs, specifying the featureOfInterests or domainFeatures for which observations are requested anyURI Zero or Many (optional)
BBOX this is not defined in the SOS spec. We are using a recommended approach in section 10.2.3 of OGC 06-121r3 minlon,minlat,maxlon,maxlat(,srsURI). The first four parameters are expected as decimal degrees. SrsURI is optional and could take a value of "urn:ogc:def:crs:EPSG:6.5:4326" One (optional)
eventTime specifies the time instant(s) or period(s) for which observations are requested the time should conform to ISO format: YYYY-MM-DDTHH:mm:ss±HH. Time instances and periods are supported. Instance is given as one time value. Periods of time (start and end) are separated by "/". For example: 2009-06-26T10:00:00+01/2009-06-26T11:00:00+01. One (optional)
responseMode specifies whether results are requested in-line, outof-band, as an attachment, or if this is a request for an observation template that will be used for subsequent calls to GetResult inline, out-of-band, attached, resultTemplate Zero or One (optional)
responseFormat specifies the desired resultFormat MIME content type for transport of the results Character String type (MIME content type) One (mandatory)
resultModel specifies the QName of the root element of an O&M Observation or element in the appropriate substitution group. QName Zero or One (optional)
srsName defines the spatial reference system that should be used for any geometries that are returned in the response urn:ogc:def:crs:EPSG:6.5:4326 One (optional). If omitted it's assumed that the SRS is WGS 84 identified as urn:ogc:def:crs:EPSG:6.5:4326

Important: FeatureOfInterest and BBOX are mutually exclusive. This means you can either specify a list of featureOfInterest/domainFeature IDs OR a Bounding Box.

The full abstract GetObservation GET request looks like this:

http://SERVERNAME:PORT/SOS_WEBAPP_NAME/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0&OFFERING=[anyURI]&OBSERVEDPROPERTY=[anyURI]&PROCEDURE=[anyURI]&FEATUREOFINTEREST=[anyURI]&BBOX=[minlon,minlat,maxlon,maxlat(,srsURI)]&EVENTTIME=[startDate/endDate]&RESPONSEMODE=[inline,out-of-band,attached,resultTemplate]&RESPONSEFORMAT=[String]&RESULTMODEL=[QName]&SRSNAME=urn:ogc:def:crs:EPSG:6.5:4326

On your local computer with default tomcat installation and no change of the SOS webapp name the request is like:

http://localhost:8080/52nSOSv3/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0...

Abstract examples:

  • basic:
http://localhost:8080/52nSOSv3/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0&OFFERING=[anyURI]&OBSERVEDPROPERTY=[anyURI]&RESPONSEFORMAT=[String]

  • with procedure:
http://localhost:8080/52nSOSv3/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0&OFFERING=[anyURI]&OBSERVEDPROPERTY=[anyURI]&PROCEDURE=[anyURI]&RESPONSEFORMAT=[String]

  • with featureOfInterest:
http://localhost:8080/52nSOSv3/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0&OFFERING=[anyURI]&OBSERVEDPROPERTY=[anyURI]&FEATUREOFINTEREST=[anyURI]&RESPONSEFORMAT=[String]

  • with BBOX:
http://localhost:8080/52nSOSv3/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0&OFFERING=[anyURI]&OBSERVEDPROPERTY=[anyURI]&BBOX=[minlon,minlat,maxlon,maxlat(,srsURI)]&RESPONSEFORMAT=[String]

  • with eventTime:
http://localhost:8080/52nSOSv3/sos?REQUEST=GetObservation&SERVICE=SOS&VERSION=1.0.0&OFFERING=[anyURI]&OBSERVEDPROPERTY=[anyURI]&EVENTTIME=[startDate/endDate]&RESPONSEFORMAT=[String]

The attributes of the GetObservation request are detailed in the Table 4 of the Sensor Observation Service specification 1.0 (OGC 06-009r6)

Get first or latest values

Here is a description of how to query the first or latest value of a time series from the SOS. You can query the first or latest value alone or combine it with an other temporal filter. In a GetObservation request use a TimeInstant in the eventTime parameter and define in timePosition getFirst or latest. For a combination define the TimeInstant for the first/latest in a relatedTime element of the TimeInstant/TimePeriod. Examples for each operation can be found in the following.

Get first value

With this query you get for each procedure the first measured value for each observed property.

<eventTime>
   <ogc:TM_Equals>
      <ogc:PropertyName>om:samplingTime</ogc:PropertyName>
      <gml:TimeInstant>
         <gml:timePosition>getFirst</gml:timePosition>
      </gml:TimeInstant>
   </ogc:TM_Equals>
</eventTime>

Get first value

With this query you get for each procedure the latest measured value for each observed property.

<eventTime>
   <ogc:TM_Equals>
      <ogc:PropertyName>om:samplingTime</ogc:PropertyName>
      <gml:TimeInstant>
         <gml:timePosition>latest</gml:timePosition>
      </gml:TimeInstant>
   </ogc:TM_Equals>
</eventTime>

-- StephanKuenster - 26 Jun 2009
Topic revision: r6 - 15 Apr 2015, CarstenHollmann
Legal Notice | Privacy Statement


This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback