Mapscript and SOS

"Peter Löwe" peter.loewe at GMX.DE
Tue Jul 3 11:11:31 EDT 2007


Hi,

the MapScript Wrappers for WxS Services indeed _do_ enable SOS requests, however, the results seem strange:

A GetObservation-query like:

http://localhost/swe/php_sos0.php?Request=GetObservation&service=SOS&offering=oid_1&observedproperty=1234&procedure=sputnik001&version=0.0.31

provides only the event time. (output follow below).

Here's the SOS-relevant content which is provided via PHP:
---------------------------
 $oLayerSensor_temp->setMetaData("sos_procedure","sputnik001");
  $oLayerSensor_temp->setMetaData("sos_offering_id", "oid_1" );
  $oLayerSensor_temp->setMetaData("sos_observedproperty_id", "1234" );
  $oLayerSensor_temp->setMetaData("sos_describesensor_url", "139.255.165.155/swe/weatherstation.xml" );
  $oLayerSensor_temp->setMetaData("sos_componenturl", "139.255.165.155/swe/component.xml" ); $oLayerSensor_temp->setMetaData("sos_observedproperty_name", "opid_name_Temperature" );
  $oLayerSensor_temp->setMetaData("sos_offering_description", "OfferingDescription_Temperature" );
  $oLayerSensor_temp->setMetaData("sos_offering_extent", "29.5.4, 34.5, 30.5, 35.5" );
  $oLayerSensor_temp->setMetaData("sos_offering_timeextent", "1982/2007" );
---------------------------
 
This is the returned XML: 

<?xml version="1.0" encoding="ISO-8859-1"?>
<om:ObservationCollection xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:swe="http://www.opengis.net/swe" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sos="http://www.opengis.net/sos" xmlns:om="http://www.opengis.net/om" gml:id="oid_1" xsi:schemaLocation="http://www.opengeospatial.net/om http://schemas.opengeospatial.net/om.xsd">
  <om:eventTime>
    <gml:TimePeriod xmlns:gml="http://www.opengis.net/gml">
      <gml:beginPosition xmlns:gml="http://www.opengis.net/gml">1982</gml:beginPosition>
      <gml:endPosition xmlns:gml="http://www.opengis.net/gml">2007</gml:endPosition>
    </gml:TimePeriod>
  </om:eventTime>
</om:ObservationCollection>

On the other hand, when the same amount of SOS-Metadata is provided through a map-file, the returned XMl is much more talkative:

<?xml version="1.0" encoding="ISO-8859-1"?>
<om:ObservationCollection xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:swe="http://www.opengis.net/swe" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sos="http://www.opengis.net/sos" xmlns:om="http://www.opengis.net/om" gml:id="gauge01" xsi:schemaLocation="http://www.opengeospatial.net/om http://schemas.opengeospatial.net/om.xsd">
  <om:eventTime>
    <gml:TimePeriod xmlns:gml="http://www.opengis.net/gml">
      <gml:beginPosition xmlns:gml="http://www.opengis.net/gml">2005</gml:beginPosition>
      <gml:endPosition xmlns:gml="http://www.opengis.net/gml">2006</gml:endPosition>
    </gml:TimePeriod>
  </om:eventTime>
  <om:member>
    <om:Observation>
      <om:procedure xlink:href="urn:ogc:def:procedure:SOSPROCEDURE_the_gauge"/>
      <observedProperty>ObservedProperty_the_gauge</observedProperty>
      <om:result>
        <gml:featureMember xmlns:gml="http://www.opengis.net/gml">
          <the_gauge>
            <gml:boundedBy xmlns:gml="http://www.opengis.net/gml">
              <gml:Envelope xmlns:gml="http://www.opengis.net/gml">
                <gml:lowerCorner srsName="epsg:4326">107.496 -7.80619</gml:lowerCorner>
                <gml:upperCorner srsName="epsg:4326">107.496 -7.80619</gml:upperCorner>
              </gml:Envelope>
            </gml:boundedBy>
            <msGeometry>
              <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="epsg:4326">
                <gml:coordinates xmlns:gml="http://www.opengis.net/gml">107.496,-7.80619</gml:coordinates>
              </gml:Point>
            </msGeometry>
          </the_gauge>
        </gml:featureMember>
      </om:result>
    </om:Observation>
  </om:member>
</om:ObservationCollection>


Any suggestions how to make the Mapscript-Wrapper version more verbose ?

CU
Peter


>There is no direct support through the scripting languages to call SOS 
>requests or any other OGC specific requests.
>You may want to look into the MapScript Wrappers for WxS Services 
>(http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript) if that can be 
>used for you purpose.
>
>Later,
>
>Peter Loewe wrote:
>> Hi,
>> 
>> does any information exist how to formulate SOS getObeservation / describeSensor >>queries when using Mapscript/PHP in the backend ?
-- 
Dr. Peter Löwe
<peter.loewe at gmx.de>





Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger



More information about the mapserver-users mailing list