The purpose of the GetResult operation is to allow a client to repeatedly obtain sensor data from the same set of sensors without having to send and receive requests and responses that largely contain the same data except for a new timestamp. A common use case is for a client to repeatedly request current sensor data from one or more sensors on a recurring basis. This operation supports that use case and allows it to occur using much less bandwidth than would be necessary for a full GetObservation call. The motivation for including the operation is to support a data center requesting data from a node that talks directly to sensors over a low bandwidth connection such as a 3G wireless link.

The GetResult operation relies on the creation of an O&M template from a previous call to GetObservation. The identifier of the template is used for subsequent GetResult calls instead of sending a duplicate GetObservation XML document. The response contains only the result portion of the O&M Observation because the other components are included by reference in the template. (SOS-Spec, OGC 06-009r6)

Example sequence

This is a typical sequence with examples for requests and reponses. The request can be excecuted with the test data from the test.sql and test_mobile.sql you can find in the db folder of your SOS.

1. Send GetObservation request with responseMode = "resultTemplate" (SOS-Spec, OGC 06-009r6)

  • Example request:
<?xml version="1.0" encoding="UTF-8"?>
<GetObservation xmlns="" xmlns:ows="" xmlns:gml="" xmlns:ogc=""
 xmlns:om="" xmlns:xsi=""
 service="SOS" version="1.0.0" srsName="urn:ogc:def:crs:EPSG:4326">

2. SOS responds with a collection of Observation templates. There is one observation template per sensor that matches the query criteria. Each template has a GML name that is unique to the SOS server. Each template has a valid time period which acts like a lease. The template is no longer valid after the expiration and subsequent GetResult requests fail after the expiration. (SOS-Spec, OGC 06-009r6)

  • Example response:
<?xml version="1.0" encoding="UTF-8"?>
<om:ObservationCollection xmlns:om="" xmlns:gml=""
 xmlns:xsi="" xmlns:xlink=""
 xmlns:swe="" gml:id="oc_0"
    <om:Observation gml:id="ot_1">
        <gml:TimePeriod xsi:type="gml:TimePeriodType">
      <om:procedure xlink:href="urn:ogc:object:feature:Sensor:IFGI:ifgi-sensor-1"/>
        <swe:CompositePhenomenon gml:id="cpid0" dimension="1">
          <swe:component xlink:href="urn:ogc:data:time:iso8601"/>
          <swe:component xlink:href="urn:ogc:def:phenomenon:OGC:1.0.30:waterlevel"/>
          <swe:elementType name="Components">
              <swe:field name="Time">
                <swe:Time definition="urn:ogc:data:time:iso8601"/>
              <swe:field name="feature">
                <swe:Text definition="urn:ogc:data:feature"/>
              <swe:field name="waterlevel">
                <swe:Quantity definition="urn:ogc:def:phenomenon:OGC:1.0.30:waterlevel">
                  <swe:uom code="cm"/>
            <swe:TextBlock decimalSeparator="." tokenSeparator="," blockSeparator=";"/>

3. Send GetResult request with no time parameter or with an "after" time representing the latest time of an observation from the previous request. This allows the client to filter out duplicates and means the server does not need to maintain state for each GetResult request. (SOS-Spec, OGC 06-009r6)

  • Example request (no time filter):
<sos:GetResult xmlns:sos="" service="SOS" version="1.0.0">

  • Example request (time filter):
<sos:GetResult xmlns:sos="" service="SOS" version="1.0.0">

4. SOS responds with result(s) including all observations available since the begin time of the lease. (SOS-Spec, OGC 06-009r6)

  • Example response:
<?xml version="1.0" encoding="UTF-8"?>
<ns:GetResultResponse xmlns:ns="" xmlns:xsi=""
  <ns:result RS="ot_1">

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

-- CarstenHollmann - 22 Apr 2009
Topic revision: r2 - 22 Apr 2009, 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