Personal tools
You are here: Home gvSIG Projects gvSIG Mobile Documentation Documentación de desarrollo org.gvsig.sensors.mobile SOS-T analysis Detailed View org.gvsig.mobile.remoteclient.sos
gvSIG Mobile
gvSIG Mobile

Cached time 11/21/13 07:46:11 Clear cache and reload

 

gvSIG Mobile will receive sensor measures, due to upload them to the SOS server, the data have to be formatted as a XML file. In order to build the answer there will be several templates with some wildcards characters, these wildcards allow be substituted with the sensor data, time, server or sensor id.

First of all the Sensor have to be registered by the SOS server. In order to do that, the SOS-T Library will try to register the sensor to the server. Next the insert sensor operation are explained.

InsertSensor Operation

The InsertSensor operation allows a client to register a new sensor system at the SOS. The operation is part of the Sensor Insertion requirements class. Sensor observations can only be inserted for sensors that have first been inserted in the SOS.

InsertSensor XML Example

52º North it’s the most complete implementation of the OGC SOS standard, because implements the transactional profile. If we take a look to the examples can think out the minimum useful template.

<?xml version="1.0" encoding="UTF-8"?>
<RegisterSensor service="SOS" version="1.0.0"
    xmlns="http://www.opengis.net/sos/1.0"
    xmlns:swe="http://www.opengis.net/swe/1.0.1"
    xmlns:ows="http://www.opengeospatial.net/ows"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns:ogc="http://www.opengis.net/ogc"
    xmlns:om="http://www.opengis.net/om/1.0"
    xmlns:sml="http://www.opengis.net/sensorML/1.0.1"
    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/sosRegisterSensor.xsd
    http://www.opengis.net/om/1.0
    http://schemas.opengis.net/om/1.0.0/extensions/observationSpecialization_override.xsd">
  
    <SensorDescription>
    
      <sml:SensorML version="1.0.1">
      <sml:member>
        <sml:System xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <sml:identification>
          <sml:IdentifierList>
            <sml:identifier>
              <sml:Term definition="urn:ogc:def:identifier:OGC:uniqueID">
                <sml:value>urn:ogc:object:feature:Sensor:### SENSOR  IDENTIFIER WILDCARD ###</sml:value>
              </sml:Term>
            </sml:identifier>
          </sml:IdentifierList>
        </sml:identification>

        <sml:capabilities>
          <swe:SimpleDataRecord>
            <swe:field name="status">
              <swe:Boolean>
                <swe:value>true</swe:value>
              </swe:Boolean>
            </swe:field>

            <swe:field name="mobile">
              <swe:Boolean>
                <swe:value>true</swe:value>
              </swe:Boolean>
            </swe:field>
          </swe:SimpleDataRecord>
        </sml:capabilities>
              
        <sml:position name="### SENSOR  NAME WILDCARD ###">
              <swe:Position referenceFrame="urn:ogc:def:crs:EPSG:4326">
                  <swe:location>
                      <swe:Vector definition="urn:ogc:def:vector:OGC:location">
                         <swe:coordinate name="latitude">
                             <swe:Quantity axisID="Y" definition="urn:ogc:def:phenomenon:latitude">
                                <swe:uom code="deg" />
                                <swe:value>### LATITUDE VALUE WILDCARD ###</swe:value>
                             </swe:Quantity>
                         </swe:coordinate>
                         <swe:coordinate name="longitude">
                            <swe:Quantity axisID="X" definition="urn:ogc:def:phenomenon:longitude">
                               <swe:uom code="deg" />
                               <swe:value>### LONGITUDE VALUE WILDCARD ###</swe:value>
                            </swe:Quantity>
                         </swe:coordinate>
                         <swe:coordinate name="altitude">
                            <swe:Quantity axisID="Z" definition="urn:ogc:def:phenomenon:altitude">
                               <swe:uom code="m" />
                               <swe:value>### ALTITUDE VALUE WILDCARD ###</swe:value>
                           </swe:Quantity>
                         </swe:coordinate>
                      </swe:Vector>
                  </swe:location>
               </swe:Position>
        </sml:position>
      
        <sml:outputs>
          <sml:OutputList>
            <sml:output name=”### OFFERING NAME WILDCARD ###”>
              <swe:Quantity definition="urn:ogc:def:phenomenon:OGC:1.0.30: ### PHENOMENON ID WILDCARD ###/">
                <gml:metaDataProperty>
                  <offering>
                    <id>### OFFERING IDENTIFIER WILDCARD ###</id>
                    <name> ### OFFERING NAME WILDCARD ###</name>
                  </offering>
                 </gml:metaDataProperty>
               <swe:uom code="grades"/>
              </swe:Quantity>
            </sml:output>
          </sml:OutputList>
        </sml:outputs>
      </sml:System>
    </sml:member>
   </sml:SensorML>
  </SensorDescription>

   <ObservationTemplate>
    <om:Measurement>
      <om:samplingTime/>
      <om:procedure/>
      <om:observedProperty/>
      <om:featureOfInterest></om:featureOfInterest>
      <om:result uom=""></om:result>
    </om:Measurement>
  </ObservationTemplate>
    
</RegisterSensor>

InsertObservation Operation

The InsertObservation operation allows clients to insert new observations for a registered sensor system.

Workflow of Observation Insertion

A sensor data producer first requests the service metadata before new observations can be inserted into an SOS.

  1. The service metadata is retrieved by invoking the GetCapabilities operation. The returned Capabilities document contains, within the Contents section, the procedures which are registered at the SOS. The InsertionCapabilities section lists the observation types and result types which are supported by the SOS for insertion.
  2. If it has not been registered at the SOS, the InsertSensor operation is called to insert the procedure description of the observation procedure. The SOS returns the ObservationOffering to which the procedure has been assigned.
  3. Finally, the observation can be inserted using the InsertObservation operation, by specifying the ObservationOffering to which it shall be uploaded.

Next are shown the minimum working XML templates that works with 52º North server.

<?xml version="1.0" encoding="UTF-8"?>
<InsertObservation xmlns="http://www.opengis.net/sos/1.0"
 xmlns:ows="http://www.opengis.net/ows/1.1"
 xmlns:ogc="http://www.opengis.net/ogc"
 xmlns:om="http://www.opengis.net/om/1.0"
 xmlns:sos="http://www.opengis.net/sos/1.0"
 xmlns:sa="http://www.opengis.net/sampling/1.0"
 xmlns:n52="http://www.52north.org/1.0"
 xmlns:gml="http://www.opengis.net/gml"
 xmlns:swe="http://www.opengis.net/swe/1.0.1"
 xmlns:xlink="http://www.w3.org/1999/xlink"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.opengis.net/sos/1.0
 http://mars.uni-muenster.de/sosmobile/trunk/sos/1.0.0/sosInsert.xsd
 http://www.opengis.net/sampling/1.0
 http://schemas.opengis.net/sampling/1.0.0/sampling.xsd
 http://www.opengis.net/om/1.0
 http://schemas.opengis.net/om/1.0.0/extensions/observationSpecialization_override.xsd"
 service="SOS" version="1.0.0">
 <AssignedSensorId>urn:ogc:object:feature:Sensor:### SENSOR  IDENTIFIER WILDCARD ###</AssignedSensorId>
  <om:Measurement>       
   <om:samplingTime>
     <gml:TimeInstant>
       <gml:timePosition>2008-04-01T19:44:15+00</gml:timePosition>
     </gml:TimeInstant>
   </om:samplingTime>
   
   <om:procedure xlink:href="urn:ogc:object:Sensor:### SENSOR  IDENTIFIER WILDCARD ###" />
   <om:observedProperty xlink:href="urn:ogc:def:phenomenon:OGC:1.0.30: : ### PHENOMENON ID WILDCARD ###" />
   
   <om:featureOfInterest>
     <n52:movingObject gml:id="human1"/>
   </om:featureOfInterest>
   
   <om:result>
     <!--
       The position of one tracking point. (Unfortunately, we do not
       support 3d coordinates, yet)
     -->
     <gml:Point srsName="urn:ogc:def:crs:EPSG:4326">
       <gml:coordinates>### SENSOR VALUES TO  INSERT ###</gml:coordinates>
     </gml:Point>
   </om:result>
   </om:Measurement>
</InsertObservation>

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: