Jump to: navigation, search

Difference between revisions of "Sensor Observation Service (SOS)"

(Inserimento di osservazioni (InsertObservation))
(Registrazione di sensori (RegisterSensor))
Line 8: Line 8:
 
==Esempi di requests validati:==
 
==Esempi di requests validati:==
 
===Registrazione di sensori (RegisterSensor)===
 
===Registrazione di sensori (RegisterSensor)===
 +
  <?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">
 +
 
 +
<!-- Sensor Description parameter; Currently, this has to be a sml:System -->
 +
<SensorDescription>
 +
<sml:SensorML version="1.0.1">
 +
<sml:member>
 +
    <sml:System xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  >
 +
       
 +
        <!--sml:identification element must contain the ID of the sensor-->
 +
          <sml:identification>
 +
              <sml:IdentifierList>
 +
                    <sml:identifier>
 +
                        <sml:Term definition="urn:ogc:def:identifier:OGC:uniqueID">
 +
                              <sml:value>urn:ogc:object:feature:Sensor:SI001137-P06:CP</sml:value>
 +
                        </sml:Term>
 +
                    </sml:identifier>
 +
              </sml:IdentifierList>
 +
          </sml:identification>
 +
         
 +
          <!-- sml:capabilities element has to contain status and mobility information -->
 +
          <sml:capabilities>
 +
                <swe:SimpleDataRecord>
 +
                    <!-- status indicates, whether sensor is collecting data at the moment (true) or not (false) -->
 +
                    <swe:field name="status">
 +
                          <swe:Boolean>
 +
                              <swe:value>true</swe:value>
 +
                            </swe:Boolean>
 +
                        </swe:field>
 +
                        <!-- status indicates, whether sensor is mobile (true) or fixed (false) -->
 +
                        <swe:field name="mobile">
 +
                            <swe:Boolean>
 +
                              <swe:value>true</swe:value>
 +
                          </swe:Boolean>
 +
                        </swe:field>
 +
                  </swe:SimpleDataRecord>
 +
          </sml:capabilities>
 +
         
 +
          <!-- last measured position of sensor -->
 +
          <sml:position name="sensorPosition">
 +
              <swe:Position referenceFrame="urn:ogc:def:crs:EPSG::4326">
 +
                    <swe:location>
 +
                        <swe:Vector gml:id="STATION_LOCATION">
 +
                              <swe:coordinate name="easting">
 +
                                  <swe:Quantity>
 +
                                        <swe:uom code="degree"/>
 +
                                        <swe:value>8.65647</swe:value>
 +
                                  </swe:Quantity>
 +
                              </swe:coordinate>
 +
                              <swe:coordinate name="northing">
 +
                                  <swe:Quantity>
 +
                                        <swe:uom code="degree"/>
 +
                                        <swe:value>45.96648</swe:value>
 +
                                  </swe:Quantity>
 +
                              </swe:coordinate>
 +
                              <swe:coordinate name="altitude">
 +
                                  <swe:Quantity>
 +
                                        <swe:uom code="m"/>
 +
                                        <swe:value>194.0</swe:value>
 +
                                  </swe:Quantity>
 +
                              </swe:coordinate>
 +
                        </swe:Vector>
 +
                    </swe:location>
 +
              </swe:Position>
 +
          </sml:position>
 +
         
 +
          <!-- list containing the input phenomena for this sensor system -->
 +
          <sml:inputs>
 +
              <sml:InputList>
 +
                    <sml:input name="CPIn">
 +
                        <swe:ObservableProperty definition="urn:ogc:def:property:OGC:1.0.30:CP_in"/>
 +
                    </sml:input>
 +
                    <sml:input name="CPPressureIn">
 +
                        <swe:ObservableProperty definition="urn:ogc:def:property:OGC:1.0.30:CP_pressure_in"/>
 +
                    </sml:input>
 +
              </sml:InputList>
 +
          </sml:inputs>
 +
         
 +
          <!-- list containing the output phenomena of this sensor system; ATTENTION: these phenomena are parsed and inserted into the database; they have to contain offering elements to determine the correct offering for the sensors and measured phenomena -->
 +
          <sml:outputs>
 +
              <sml:OutputList>
 +
                    <sml:output name="CP">
 +
                        <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
 +
                                <gml:metaDataProperty>
 +
<offering>
 +
<id>CP</id>
 +
<name>Chlorophyll</name>
 +
</offering>
 +
</gml:metaDataProperty>
 +
                              <swe:uom code="ug/l"/>
 +
                        </swe:Quantity>
 +
                    </sml:output>
 +
                    <sml:output name="Depth">
 +
                        <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:pressure">
 +
<gml:metaDataProperty>
 +
<offering>
 +
<id>CP</id>
 +
<name>Depth</name>
 +
</offering>
 +
</gml:metaDataProperty>
 +
                                <swe:uom code="m"/>
 +
                        </swe:Quantity>
 +
                    </sml:output>
 +
              </sml:OutputList>
 +
          </sml:outputs>
 +
 +
  </sml:System>
 +
    </sml:member>
 +
    </sml:SensorML>
 +
</SensorDescription>
 +
 +
    <!-- ObservationTemplate parameter; this has to be an empty measurement at the moment, as the 52N SOS only supports Measurements to be inserted -->
 +
    <ObservationTemplate>
 +
          <om:Observation>
 +
              <om:samplingTime></om:samplingTime>
 +
              <om:procedure></om:procedure>
 +
              <om:observedProperty></om:observedProperty>
 +
              <om:featureOfInterest></om:featureOfInterest>
 +
              <om:result></om:result>
 +
          </om:Observation>
 +
    </ObservationTemplate>
 +
   
 +
</RegisterSensor>
  
 
===Inserimento di osservazioni (InsertObservation)===
 
===Inserimento di osservazioni (InsertObservation)===

Revision as of 16:42, 5 February 2014

Server SOS utilizzato: 52North versione 3.2 (NOTA: implementa versione OGC SOS 1.0.0 - cf. Arthur Na (IRIS Corp.), Mark Priest (3eTI) OGC 06-009r6.)

Prerequisiti: postgres fino <= 9.0, postgis <= 1.5

...

Esempi di requests validati:

Registrazione di sensori (RegisterSensor)

 <?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:SI001137-P06:CP</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="sensorPosition">
              <swe:Position referenceFrame="urn:ogc:def:crs:EPSG::4326">
                   <swe:location>
                        <swe:Vector gml:id="STATION_LOCATION">
                             <swe:coordinate name="easting">
                                  <swe:Quantity>
                                       <swe:uom code="degree"/>
                                       <swe:value>8.65647</swe:value>
                                  </swe:Quantity>
                             </swe:coordinate>
                             <swe:coordinate name="northing">
                                  <swe:Quantity>
                                       <swe:uom code="degree"/>
                                       <swe:value>45.96648</swe:value>
                                  </swe:Quantity>
                             </swe:coordinate>
                             <swe:coordinate name="altitude">
                                  <swe:Quantity>
                                       <swe:uom code="m"/>
                                       <swe:value>194.0</swe:value>
                                  </swe:Quantity>
                             </swe:coordinate>
                        </swe:Vector>
                   </swe:location>
              </swe:Position>
         </sml:position>
         
         <sml:inputs>
              <sml:InputList>
                   <sml:input name="CPIn">
                        <swe:ObservableProperty definition="urn:ogc:def:property:OGC:1.0.30:CP_in"/>
                   </sml:input>
                   <sml:input name="CPPressureIn">
                        <swe:ObservableProperty definition="urn:ogc:def:property:OGC:1.0.30:CP_pressure_in"/>
                   </sml:input>
              </sml:InputList>
         </sml:inputs>
         
         <sml:outputs>
              <sml:OutputList>
                   <sml:output name="CP">
                        <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
                               <gml:metaDataProperty>

<offering> <id>CP</id> <name>Chlorophyll</name> </offering> </gml:metaDataProperty>

                             <swe:uom code="ug/l"/>
                        </swe:Quantity>
                   </sml:output>
                   <sml:output name="Depth">
                        <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:pressure">

<gml:metaDataProperty> <offering> <id>CP</id> <name>Depth</name> </offering> </gml:metaDataProperty>

                                <swe:uom code="m"/>
                        </swe:Quantity>
                   </sml:output>
              </sml:OutputList>
         </sml:outputs>

</sml:System>

    </sml:member>
    </sml:SensorML>

</SensorDescription>

    <ObservationTemplate>
         <om:Observation>
              <om:samplingTime></om:samplingTime>
              <om:procedure></om:procedure>
              <om:observedProperty></om:observedProperty>
              <om:featureOfInterest></om:featureOfInterest>
              <om:result></om:result>
         </om:Observation>
    </ObservationTemplate>
    

</RegisterSensor>

Inserimento di osservazioni (InsertObservation)

 <?xml version="1.0"?>
 <InsertObservation xsi:schemaLocation="http://www.opengis.net/sos/1.0 http://schemas.opengis.net/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" 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: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">
<AssignedSensorId>urn:ogc:object:feature:Sensor:SI001137-P06:CP</AssignedSensorId>
<om:Observation>
 <om:samplingTime>
  <gml:TimePeriod xsi:type="gml:TimePeriodType">
   <gml:beginPosition>1981-01-15T10:02:00+01</gml:beginPosition>
   <gml:endPosition>2011-12-15T10:02:00+01</gml:endPosition>
  </gml:TimePeriod>
 </om:samplingTime>
 <om:procedure xlink:href="urn:ogc:object:feature:Sensor:SI001137-P06:CP"/>
 <om:observedProperty>
  <swe:CompositePhenomenon gml:id="cpid0" dimension="1">
   <gml:name>resultComponents</gml:name>
   <swe:component xlink:href="urn:ogc:data:time:iso8601"/>
   <swe:component xlink:href="urn:ogc:def:property:OGC:1.0.30:CP"/>
   <swe:component xlink:href="urn:ogc:def:property:OGC:1.0.30:pressure"/>
  </swe:CompositePhenomenon>
 </om:observedProperty>
 <om:featureOfInterest>
    <sa:SamplingPoint gml:id="SI001137-P06">
     <gml:name>SI001137-P06</gml:name>
     <sa:sampledFeature xlink:href=""/>
     <sa:position>
      <gml:Point>
       <gml:pos srsName="urn:ogc:def:crs:EPSG::4326">45.96648 8.65647</gml:pos>
      </gml:Point>
     </sa:position>
    </sa:SamplingPoint>
 </om:featureOfInterest>
 <om:result>
  <swe:DataArray>
   <swe:elementCount>
    <swe:Count>
     <swe:value>2</swe:value>
    </swe:Count>
   </swe:elementCount>
   <swe:elementType name="Components">
    <swe:DataRecord>
     <swe:field name="Time">
      <swe:Time definition="urn:ogc:data:time:iso8601"/>
     </swe:field>
     <swe:field name="feature">
      <swe:Text definition="urn:ogc:data:feature"/>
     </swe:field>
     <swe:field name="CP">
      <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
       <swe:uom code="ug/l"/>
      </swe:Quantity>
     </swe:field>
     <swe:field name="Depth">
      <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:pressure">
       <swe:uom code="m"/>
      </swe:Quantity>
     </swe:field>
    </swe:DataRecord>
   </swe:elementType>
   <swe:encoding>
    <swe:TextBlock decimalSeparator="." tokenSeparator="," blockSeparator=";"/>
   </swe:encoding>     <swe:values>1997-12-15T10:02:00+01,SI001137-P06,0.83,-10;1991-05-15T10:02:00+01,SI001137-P06,6.03,-10;</swe:values>
  </swe:DataArray>
 </om:result>
</om:Observation>

</InsertObservation>

Richiesta di osservazioni (GetObservation)