Sensor and observation insertion

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sensor and observation insertion

nicc
This post was updated on .
Hello,
I'm a new user of 52N SOS and I'm investigating SOS capabilities.

In particular, I tried to insert a new sensor, with a single array observation, consisting in 5 values.

This is my InsertSensor:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
    xmlns:env="http://www.w3.org/2003/05/soap-envelope"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0/sosInsertSensor.xsd     http://www.opengis.net/swes/2.0 http://schemas.opengis.net/swes/2.0/swes.xsd">
    <env:Body>
        <swes:InsertSensor service="SOS" version="2.0.0"
            xmlns:swes="http://www.opengis.net/swes/2.0"
            xmlns:sos="http://www.opengis.net/sos/2.0"
            xmlns:swe="http://www.opengis.net/swe/2.0"
            xmlns:sml="http://www.opengis.net/sensorml/2.0"
            xmlns:gml="http://www.opengis.net/gml/3.2"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:gco="http://www.isotc211.org/2005/gco"
            xmlns:gmd="http://www.isotc211.org/2005/gmd">
            <swes:procedureDescriptionFormat>http://www.opengis.net/sensorml/2.0</swes:procedureDescriptionFormat>
            <swes:procedureDescription>
                <sml:PhysicalSystem gml:id="GenSensor">
                   
                    <gml:identifier codeSpace="uniqueID">http://www.xxxxxx.it/procedure/Gen</gml:identifier>
                    <sml:identification>
                        <sml:IdentifierList>
                            <sml:identifier>
                                <sml:Term definition="urn:ogc:def:identifier:OGC:1.0:longName">
                                    <sml:label>longName</sml:label>
                                    <sml:value>Gen SRL Sensor
                                                                        </sml:value>
                                </sml:Term>
                            </sml:identifier>
                            <sml:identifier>
                                <sml:Term definition="urn:ogc:def:identifier:OGC:1.0:shortName">
                                    <sml:label>shortName</sml:label>
                                    <sml:value>Gen</sml:value>
                                </sml:Term>
                            </sml:identifier>
                        </sml:IdentifierList>
                    </sml:identification>
                    <sml:capabilities name="offerings">
                        <sml:CapabilityList>
                            <sml:capability name="offeringID">
                                <swe:Text definition="urn:ogc:def:identifier:OGC:offeringID">
                                    <swe:label>offeringID</swe:label>
                                    <swe:value>http://www.xxxxxx.it/offering/Gen</swe:value>
                                </swe:Text>
                            </sml:capability>
                        </sml:CapabilityList>
                    </sml:capabilities>
                    <sml:featuresOfInterest>
                        <sml:FeatureList definition="http://www.opengis.net/def/featureOfInterest/identifier">
                            <swe:label>featuresOfInterest</swe:label>
                            <sml:feature xlink:href="http://www.xxxxxx.it/featureOfInterest/Gen"/>
                        </sml:FeatureList>
                    </sml:featuresOfInterest>
                    <sml:inputs>
                        <sml:InputList>
                            <sml:input name="test_observable_property_xxxxxx">
                                <sml:ObservableProperty definition="http://www.xxxxxx.it/test/observableProperty/Gen"/>
                            </sml:input>
                        </sml:InputList>
                    </sml:inputs>
                    <sml:outputs>
                        <sml:OutputList>
                            <sml:output name="xxxxxx_temp">
                                <swe:DataArray>
                                    <swe:elementCount>
                                      <swe:Count>
                                        <swe:value>5</swe:value>
                                      </swe:Count>
                                    </swe:elementCount>
                                    <swe:elementType name="xxxxxx_temp">
                                        <swe:DataRecord>
                                            <swe:field name="xxxxxx_temp">
                                                <swe:Quantity definition="http://www.xxxxxx.it/test/observableProperty/Gen">
                                                    <swe:uom code="degrees"/>
                                                </swe:Quantity>
                                            </swe:field>
                                        </swe:DataRecord>
                                    </swe:elementType>
                                </swe:DataArray>
                            </sml:output>
                        </sml:OutputList>
                    </sml:outputs>
                    <sml:attachedTo xlink:href="http://www.xxxxxx.it/procedure/Gen" xlink:title="http://www.xxxxxx.it/procedure/Gen"/>
                    <sml:position>
                        <swe:Vector referenceFrame="urn:ogc:def:crs:EPSG::4326">
                            <swe:coordinate name="easting">
                                <swe:Quantity axisID="x">
                                    <swe:uom code="degree"/>
                                    <swe:value>10.440377</swe:value>
                                </swe:Quantity>
                            </swe:coordinate>
                            <swe:coordinate name="northing">
                                <swe:Quantity axisID="y">
                                    <swe:uom code="degree"/>
                                    <swe:value>43.684173</swe:value>
                                </swe:Quantity>
                            </swe:coordinate>
                        </swe:Vector>
                    </sml:position>
                </sml:PhysicalSystem>
            </swes:procedureDescription>
           
            <swes:observableProperty>http://www.xxxxxx.it/test/observableProperty/Gen</swes:observableProperty>

          <swes:metadata>
                <sos:SosInsertionMetadata>
                    <sos:observationType>http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation</sos:observationType>
                    <sos:featureOfInterestType>http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint</sos:featureOfInterestType>
                </sos:SosInsertionMetadata>
            </swes:metadata>
        </swes:InsertSensor>
    </env:Body>
</env:Envelope>



And this is my InsertObservation:


<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
    xmlns:env="http://www.w3.org/2003/05/soap-envelope"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd">
    <env:Body>
        <sos:InsertObservation service="SOS" version="2.0.0"
            xmlns:sos="http://www.opengis.net/sos/2.0"
            xmlns:swes="http://www.opengis.net/swes/2.0"
            xmlns:swe="http://www.opengis.net/swe/2.0"
            xmlns:sml="http://www.opengis.net/sensorML/1.0.1"
            xmlns:gml="http://www.opengis.net/gml/3.2"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            xmlns:om="http://www.opengis.net/om/2.0"
            xmlns:sams="http://www.opengis.net/samplingSpatial/2.0"
            xmlns:sf="http://www.opengis.net/sampling/2.0" xsi:schemaLocation="http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0/sos.xsd            http://www.opengis.net/samplingSpatial/2.0 http://schemas.opengis.net/samplingSpatial/2.0/spatialSamplingFeature.xsd">
           
            <sos:offering>http://www.xxxxxx.it/offering/Gen</sos:offering>
            <sos:observation>
                <om:OM_Observation gml:id="o1">
                    <om:type xlink:href="http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation"/>
                    <om:phenomenonTime>
                        <gml:TimePeriod gml:id="phenomenonTime">
                            <gml:beginPosition>2016-06-01T13:30:00+02:00</gml:beginPosition>
                            <gml:endPosition>2016-07-08T13:44:00+02:00</gml:endPosition>
                        </gml:TimePeriod>
                    </om:phenomenonTime>
                    <om:resultTime>
                        <gml:TimeInstant gml:id="resultTime">
                            <gml:timePosition>2016-07-08T13:50:00+02:00</gml:timePosition>
                        </gml:TimeInstant>
                    </om:resultTime>
                  <om:procedure xlink:href="http://www.xxxxxx.it/procedure/Gen"/>
                    <om:observedProperty xlink:href="http://www.xxxxxx.it/test/observableProperty/Gen"/>
                    <om:featureOfInterest>
                        <sams:SF_SpatialSamplingFeature gml:id="ssf_test_feature_gen">
                            <gml:identifier codeSpace="">http://www.xxxxxx.it/featureOfInterest/Gen</gml:identifier>
                            <gml:name>xxxxxx</gml:name>
                            <sf:type xlink:href="http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint"/>
                            <sf:sampledFeature xlink:href="http://www.xxxxxx.it/featureOfInterest/Gen1"/>
                            <sams:shape>
                                <gml:Point gml:id="test_feature_gen">
                                    <gml:pos srsName="http://www.opengis.net/def/crs/EPSG/0/4326">43.684173 10.440377</gml:pos>
                                </gml:Point>
                            </sams:shape>
                        </sams:SF_SpatialSamplingFeature>
                    </om:featureOfInterest>
                    <om:result xsi:type="swe:DataArrayPropertyType">
                        <swe:DataArray>
                            <swe:elementCount>
                                <swe:Count>
                                    <swe:value>5</swe:value>
                                </swe:Count>
                            </swe:elementCount>
                            <swe:elementType name="defs">
                                <swe:DataRecord>
                                    <swe:field name="phenomenonTime">
                                        <swe:Time definition="http://www.opengis.net/def/property/OGC/0/PhenomenonTime">
                                            <swe:uom xlink:href="http://www.opengis.net/def/uom/ISO-8601/0/Gregorian"/>
                                        </swe:Time>
                                    </swe:field>
                                    <swe:field name="test_observable_property_xxxxxx">
                                        <swe:Quantity definition="http://www.xxxxxx.it/test/observableProperty/Gen">
                                            <swe:uom code="test_unit_gen"/>
                                        </swe:Quantity>
                                    </swe:field>
                                </swe:DataRecord>
                            </swe:elementType>
                            <swe:encoding>
                                <swe:TextEncoding tokenSeparator="#" blockSeparator="@"/>
                            </swe:encoding>
                            <swe:values>
                                                                2016-07-01T13:30:00+02:00#30.15@
                                                                2016-07-02T13:30:00+02:00#29.15@
                                                                2016-07-03T13:30:00+02:00#28.15@
                                                                2016-07-04T13:30:00+02:00#27.15@
                                                                2016-07-05T13:30:00+02:00#26.15
                                                        </swe:values>
                        </swe:DataArray>
                    </om:result>
                </om:OM_Observation>
            </sos:observation>
        </sos:InsertObservation>
    </env:Body>
</env:Envelope>


As I can see from the answer messages from the client, I receive neither errors nor exceptions.
If I open the JSClient, I can see the landmark on the map.
The problem is that when I click on it I receive this error message:

An Error Occurred: Resource with ID '8' could not be found.


I'm quite disapponted, since I can't understand what does the ID '8' stands for.

Am I missing a step or something like that?
Did I make some mistakes in InsertSensor or InsertObservation?
And moreover, does any tutorial exist about this matter?

Thank you in advance for your help.


For completeness sake, I include the answers I receive after InsertSensor and InsertObservation:

    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:swes="http://www.opengis.net/swes/2.0" xsi:schemaLocation="http://www.opengis.net/swes/2.0 http://schemas.opengis.net/swes/2.0/swesInsertSensor.xsd http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <swes:InsertSensorResponse>
          <swes:assignedProcedure>http://www.xxxxxx.it/procedure/Gen</swes:assignedProcedure>
          <swes:assignedOffering>http://www.xxxxxx.it/offering/Gen</swes:assignedOffering>
        </swes:InsertSensorResponse>
      </soap:Body>
    </soap:Envelope>


    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sos="http://www.opengis.net/sos/2.0" xsi:schemaLocation="http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0/sosInsertObservation.xsd http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <sos:InsertObservationResponse/>
      </soap:Body>
    </soap:Envelope>



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sensor and observation insertion

nicc
I checked the logfile and I found this line:

2016-09-08 15:20:46,323 DEBUG [http-nio-8080-exec-7] [TimeseriesRepository.java:164] Series entry '8' without UOM will be ignored!

What is the missing UOM and how can I fix this problem?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sensor and observation insertion

Henning Bredel-2

hi,

you defined Count as output for degrees. use Quantity and add a uom value.

Series REST API versions < 2 only support quantity values. That API can be used by a lightweight Web client to consume data from SOS.

Howecer, current dev line 2.0 will support Count or Text.

Best

  Henning


Am 08.09.2016 16:08 schrieb "nicc" <[hidden email]>:
I checked the logfile and I found this line:

2016-09-08 15:20:46,323 DEBUG [http-nio-8080-exec-7]
[TimeseriesRepository.java:164] Series entry '8' without UOM will be
ignored!

What is the missing UOM and how can I fix this problem?




--
View this message in context: http://sensorweb.forum.52north.org/Sensor-and-observation-insertion-tp4028669p4028671.html
Sent from the 52° North - Sensor Web Community Forum mailing list archive at Nabble.com.
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines

_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sensor and observation insertion

Carsten Hollmann
In reply to this post by nicc
Hi,

if you insert an observation as SweDataArray, the SOS stores this as a
string in the database. The REST-API, used by the JSClient, only
supports quantity/measurement values that are stored as single
observations in the SOS.

To insert many observations into the SOS you have threes options.

1) Insert single OM_Measurement observations
2) Use the SplitDataArrayIntoObservations [0] which inserts the values
of a SweDataArray observation as single observation into the SOS.
3) Use the InsertResultTemplate and InsertResult operations.

In the SOS Test Client you find examples for the
SplitDataArrayIntoObservations-InsertObservation and the
InsertResultTemplate/InsertResult operations.

Best,
Carsten
[0]
https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation#SplitDataArrayIntoObservations
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sensor and observation insertion

nicc
In reply to this post by nicc
Thank you all for your help, now it works fine.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sensor and observation insertion

narutoo9x
Hi @nicc, what approach do you use?

I want to insert multiple observations of multiple observableProperty of one procedure. Is it impossible?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sensor and observation insertion

Carsten Hollmann
Hi,

You have these options to insert observations into the SOS:

1) Insert single OM_Measurement observations
2) Use the SplitDataArrayIntoObservations [0] which inserts the values
of a SweDataArray observation as single observation into the SOS.
3) Use the InsertResultTemplate and InsertResult operations.

Since O&M 2.0 allows only one observedProperty in a OM_Observation, can
use the options 2 and 3 to insert multiple observations for one
observedProperty. That means that you have to create new
InsertObservation/InsertResultTemplate/InsertResult requests for each
observedProperty.

Best,
Carsten
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Loading...