Jump to: navigation, search

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

(Inserimento di osservazioni (InsertObservation))
(Inserimento di osservazioni (InsertObservation))
 
(13 intermediate revisions by 2 users not shown)
Line 24: Line 24:
 
   http://schemas.opengis.net/om/1.0.0/extensions/observationSpecialization_override.xsd">
 
   http://schemas.opengis.net/om/1.0.0/extensions/observationSpecialization_override.xsd">
 
    
 
    
<!-- Sensor Description parameter; Currently, this has to be a sml:System -->
+
<!-- Sensor Description parameter; Currently, this has to be a sml:System -->
<SensorDescription>
+
<SensorDescription>
<sml:SensorML version="1.0.1">
+
<sml:SensorML version="1.0.1">
<sml:member>
+
<sml:member>
 
     <sml:System xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  >
 
     <sml:System xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  >
 
          
 
          
Line 92: Line 92:
 
                     <sml:input name="CPIn">
 
                     <sml:input name="CPIn">
 
                         <swe:ObservableProperty definition="urn:ogc:def:property:OGC:1.0.30:CP_in"/>
 
                         <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:input>
 
               </sml:InputList>
 
               </sml:InputList>
 
           </sml:inputs>
 
           </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 -->
+
           <!-- 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:outputs>
 
               <sml:OutputList>
 
               <sml:OutputList>
 
                     <sml:output name="CP">
 
                     <sml:output name="CP">
 
                         <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
 
                         <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
                                <gml:metaDataProperty>
+
                          <gml:metaDataProperty>
<offering>
+
                          <offering>
<id>CP</id>
+
                            <id>CP</id>
<name>Chlorophyll</name>
+
                            <name>Chlorophyll</name>
</offering>
+
                          </offering>
</gml:metaDataProperty>
+
                          </gml:metaDataProperty>
                              <swe:uom code="ug/l"/>
+
                          <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>
 
                         </swe:Quantity>
 
                     </sml:output>
 
                     </sml:output>
 
               </sml:OutputList>
 
               </sml:OutputList>
 
           </sml:outputs>
 
           </sml:outputs>
 
+
        </sml:System>
  </sml:System>
+
 
     </sml:member>
 
     </sml:member>
    </sml:SensorML>
+
    </sml:SensorML>
</SensorDescription>
+
</SensorDescription>
 
+
     <!-- ObservationTemplate parameter; this has to be an empty measurement at the moment, as the 52N SOS only supports Measurements to be inserted -->
+
     <!-- ObservationTemplate parameter;  
 +
      this has to be an empty measurement at the moment, as the 52N SOS only supports Measurements to be inserted -->
 
     <ObservationTemplate>
 
     <ObservationTemplate>
 
           <om:Observation>
 
           <om:Observation>
Line 143: Line 131:
 
     </ObservationTemplate>
 
     </ObservationTemplate>
 
      
 
      
</RegisterSensor>
+
</RegisterSensor>
  
 
===Inserimento di osservazioni (InsertObservation)===
 
===Inserimento di osservazioni (InsertObservation)===
Line 168: Line 156:
 
     <swe:component xlink:href="urn:ogc:data:time:iso8601"/>
 
     <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:CP"/>
    <swe:component xlink:href="urn:ogc:def:property:OGC:1.0.30:pressure"/>
 
 
   </swe:CompositePhenomenon>
 
   </swe:CompositePhenomenon>
 
   </om:observedProperty>
 
   </om:observedProperty>
Line 200: Line 187:
 
       <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
 
       <swe:Quantity definition="urn:ogc:def:property:OGC:1.0.30:CP">
 
         <swe:uom code="ug/l"/>
 
         <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:Quantity>
 
       </swe:field>
 
       </swe:field>
Line 211: Line 193:
 
     <swe:encoding>
 
     <swe:encoding>
 
     <swe:TextBlock decimalSeparator="." tokenSeparator="," blockSeparator=";"/>
 
     <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:encoding>
 +
    <swe:values>1997-12-15T10:02:00+01,SI001137-P06,0.83;1991-05-15T10:02:00+01,SI001137-P06,6.03;</swe:values>
 
   </swe:DataArray>
 
   </swe:DataArray>
 
   </om:result>
 
   </om:result>
 
  </om:Observation>
 
  </om:Observation>
</InsertObservation>
+
</InsertObservation>
  
 
===Richiesta di osservazioni (GetObservation)===
 
===Richiesta di osservazioni (GetObservation)===

Latest revision as of 17:16, 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: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: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: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:DataRecord>
   </swe:elementType>
   <swe:encoding>
    <swe:TextBlock decimalSeparator="." tokenSeparator="," blockSeparator=";"/>
   </swe:encoding>
    <swe:values>1997-12-15T10:02:00+01,SI001137-P06,0.83;1991-05-15T10:02:00+01,SI001137-P06,6.03;</swe:values>
  </swe:DataArray>
 </om:result>
</om:Observation>
</InsertObservation>

Richiesta di osservazioni (GetObservation)