[52N SWE] How to update sensor status/location

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[52N SWE] How to update sensor status/location

cparent
Hello, I am trying to update a mobile sensor's status and location via an example UpdateSensor document I have found. when I submit an UpdateSensor request I get an error from the SOS service processing that request. The UpdateRequest does not have a SensorML description in it. I'm not sure if I'm looking at an old example or the code does not currently support. Please advise, thank you!

-Chris



Here is my request - found this on the Wiki. I have parameterized some values:

<?xml version="1.0" encoding="UTF-8"?>
<UpdateSensor service="SOS" version="1.0.0" mobileEnabled="true" xmlns="http://www.opengis.net/sos/1.0"
 xmlns:ows="http://www.opengeospatial.net/ows" xmlns:gml="http://www.opengis.net/gml"
 xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:sos="http://www.opengis.net/sos/1.0" xmlns:swe="http://www.opengis.net/swe/1.0.1"
 xsi:schemaLocation="http://www.opengis.net/sos/1.0
 http://mars.uni-muenster.de/SOSmobile/trunk/sos/1.0.0/sosUpdateSensor.xsd">
   <SensorID>@SENSOR_UNIQUE_ID@</SensorID>
   <timeStamp>
      <gml:timePosition>2008-04-01T17:45:15+00</gml:timePosition>
   </timeStamp>
   <position>
      <swe:location>
         <swe:Vector referenceFrame="urn:ogc:def:crs:EPSG:4326">
            <swe:coordinate name="xcoord">
               <swe:Quantity>
                  <swe:value>@SENSOR_LON@</swe:value>
               </swe:Quantity>
            </swe:coordinate>
            <swe:coordinate name="ycoord">
               <swe:Quantity>
                  <swe:value>@SENSOR_LAT@</swe:value>
               </swe:Quantity>
            </swe:coordinate>
         </swe:Vector>
      </swe:location>
   </position>
     <domainFeature>
      <GenericDomainFeature gml:id="investigationArea1">
         <gml:description>Paderborn</gml:description>
         <gml:name>City of paderborn</gml:name>
         <gml:location>
            <gml:Polygon srsName="4326" xsi:type="gml:PolygonType">
               <gml:exterior>
                  <gml:LinearRing xsi:type="gml:LinearRingType">
                     <gml:coordinates>8.76667 51.7167, 8.76667 52.7167, 9.76667 52.7167, 9.76667 51.7167, 8.76667 51.7167</gml:coordinates>
                  </gml:LinearRing>
               </gml:exterior>
            </gml:Polygon>
         </gml:location>
      </GenericDomainFeature>
   </domainFeature>
   <isMobile>@SENSOR_MOBILE@</isMobile>
   <isActive>@SENSOR_STATUS@</isActive>
</UpdateSensor>


Here is the response I get from SOS:

Sep 20, 2010 12:19:53 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet SOS threw exception
java.lang.NullPointerException
    at org.n52.sos.decode.impl.SensorMLDecoder.parsePointPosition(SensorMLDecoder.java:363)
    at org.n52.sos.decode.impl.HttpPostRequestDecoderMobile.parseUpdateSensorDocument(HttpPostRequestDecoderMobile.java:479)
    at org.n52.sos.decode.impl.HttpPostRequestDecoderMobile.receiveRequest(HttpPostRequestDecoderMobile.java:277)
    at org.n52.sos.RequestOperator.doPostOperation(RequestOperator.java:194)
    at org.n52.sos.SOS.doPost(SOS.java:399)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)



_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: [52N SWE] How to update sensor status/location

Matthes Rieke
Hi Christopher,

I had a short look at your XML example and it seems there is a mistake in it: in the <position> element the <swe:Position> element is missing. I think it could work (I am not a SOS developer) with changing the position to:

   <position>
      <swe:Position>
      <swe:location>
         <swe:Vector referenceFrame="urn:ogc:def:crs:EPSG:4326">
            <swe:coordinate name="xcoord">
               <swe:Quantity>
                  <swe:value>@SENSOR_LON@</swe:value>
               </swe:Quantity>
            </swe:coordinate>
            <swe:coordinate name="ycoord">
               <swe:Quantity>
                  <swe:value>@SENSOR_LAT@</swe:value>
               </swe:Quantity>
            </swe:coordinate>
         </swe:Vector>
      </swe:location>
      </swe:Position>
   </position>

Kind Regards,
Matthes

2010/9/20 Christopher Parent <[hidden email]>
Hello, I am trying to update a mobile sensor's status and location via an example UpdateSensor document I have found. when I submit an UpdateSensor request I get an error from the SOS service processing that request. The UpdateRequest does not have a SensorML description in it. I'm not sure if I'm looking at an old example or the code does not currently support. Please advise, thank you!

-Chris



Here is my request - found this on the Wiki. I have parameterized some values:

<?xml version="1.0" encoding="UTF-8"?>
<UpdateSensor service="SOS" version="1.0.0" mobileEnabled="true" xmlns="http://www.opengis.net/sos/1.0"
 xmlns:ows="http://www.opengeospatial.net/ows" xmlns:gml="http://www.opengis.net/gml"
 xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:sos="http://www.opengis.net/sos/1.0" xmlns:swe="http://www.opengis.net/swe/1.0.1"
 xsi:schemaLocation="http://www.opengis.net/sos/1.0
 http://mars.uni-muenster.de/SOSmobile/trunk/sos/1.0.0/sosUpdateSensor.xsd">
   <SensorID>@SENSOR_UNIQUE_ID@</SensorID>
   <timeStamp>
      <gml:timePosition>2008-04-01T17:45:15+00</gml:timePosition>
   </timeStamp>
   <position>
      <swe:location>
         <swe:Vector referenceFrame="urn:ogc:def:crs:EPSG:4326">
            <swe:coordinate name="xcoord">
               <swe:Quantity>
                  <swe:value>@SENSOR_LON@</swe:value>
               </swe:Quantity>
            </swe:coordinate>
            <swe:coordinate name="ycoord">
               <swe:Quantity>
                  <swe:value>@SENSOR_LAT@</swe:value>
               </swe:Quantity>
            </swe:coordinate>
         </swe:Vector>
      </swe:location>
   </position>
     <domainFeature>
      <GenericDomainFeature gml:id="investigationArea1">
         <gml:description>Paderborn</gml:description>
         <gml:name>City of paderborn</gml:name>
         <gml:location>
            <gml:Polygon srsName="4326" xsi:type="gml:PolygonType">
               <gml:exterior>
                  <gml:LinearRing xsi:type="gml:LinearRingType">
                     <gml:coordinates>8.76667 51.7167, 8.76667 52.7167, 9.76667 52.7167, 9.76667 51.7167, 8.76667 51.7167</gml:coordinates>
                  </gml:LinearRing>
               </gml:exterior>
            </gml:Polygon>
         </gml:location>
      </GenericDomainFeature>
   </domainFeature>
   <isMobile>@SENSOR_MOBILE@</isMobile>
   <isActive>@SENSOR_STATUS@</isActive>
</UpdateSensor>


Here is the response I get from SOS:

Sep 20, 2010 12:19:53 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet SOS threw exception
java.lang.NullPointerException
    at org.n52.sos.decode.impl.SensorMLDecoder.parsePointPosition(SensorMLDecoder.java:363)
    at org.n52.sos.decode.impl.HttpPostRequestDecoderMobile.parseUpdateSensorDocument(HttpPostRequestDecoderMobile.java:479)
    at org.n52.sos.decode.impl.HttpPostRequestDecoderMobile.receiveRequest(HttpPostRequestDecoderMobile.java:277)
    at org.n52.sos.RequestOperator.doPostOperation(RequestOperator.java:194)
    at org.n52.sos.SOS.doPost(SOS.java:399)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)



_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org



_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org