Get an Observation at a location

This use case is to get an observation at a specific location. There is a nice BBOX example in OGC 06-009r6 ( that I have adapted to our situation


   service="SOS" version="1.0.0" srsName="EPSG:4326">
            <gml:lowerCorner>-79 44</gml:lowerCorner>
            <gml:upperCorner>-78 45</gml:upperCorner>
   <sos:responseFormat>text/xml; subtype=&quot;om/1.0.0&quot;</sos:responseFormat>
   <sos:resultModel xmlns:wml="">wml:WaterMonitoringObservation</sos:resultModel>

This asks for all Observation of offering "urn:GIN:offering:groundwaterLevel:1" where the Observed property is urn:ogc:def:property:OGC:GroundWaterLevel where the location of the wml:WaterMonitoringObservation is within -90,45,-89,46.

Interesting note, the srsName is not on the property, but on the root tag (GetObservation)


From the mock up service I implemented on GIN


  • The BBOX request uses the featureOfInterest to constrains the location, which means that the client must have a prior knowledge of what feature is of interest and what is the schema of that feature. Which is a problem. Right now, I'm ignoring the property.

Implementation in a WMS:GetFeatureInfo context

To query data in a GetFeatureInfo context, we must convert the pixel based request into a real world coordinate.

The simplest way is to create a proxy service that get the GetFeatureInfo, rewrite it in terms of SOS BBOX above and route it to the SOS service.

A GetFeatureInfo query looks like VERSION=1.1.1 &FORMAT=image%2Fpng &LAYERS=OntarioWaterWell &SERVICE=WMS &REQUEST=GetFeatureInfo &STYLES= &EXCEPTIONS=application%2Fvnd.ogc.se_xml &TRANSPARENT=TRUE &SRS=EPSG%3A4326 &BBOX=-90.151733,48.078798,-89.55857,48.519867 &X=416&Y=224 &INFO_FORMAT=text%2Fhtml &QUERY_LAYERS=OntarioWaterWell &WIDTH=780 &HEIGHT=580

There is basically all the same info than a WMS GetMap request (because the response might want to draw the map along with the data). The important bits are

&BBOX=-90.151733,48.078798,-89.55857,48.519867 (minx,miny,maxx,maxy) &X=416&Y=224 &WIDTH=780 &HEIGHT=580

The real world location can easily be calculated with

  • nx = (x / width) * (maxx - minx) + minx
  • ny = ((height - y) / height) * (maxy - miny) + miny (note that Y axis in pixel is downward)

With this, you can easier rewrite the BBOX request above.

-- EricBoisvert - 25 Nov 2009
Topic revision: r4 - 01 Dec 2009, EricBoisvert

This site is powered by FoswikiThe information you supply is used for OGC purposes only. We will never pass your contact details to any third party without your prior consent.
If you enter content here you are agreeing to the OGC privacy policy.

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding OGC Public Wiki? Send feedback