JSON insertObservation SWEArrayObservation

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

JSON insertObservation SWEArrayObservation

Toni Aparici
Hi, I'm trying insert an observation from an access control sensor, it has two fields, the result of the access "allow" or "deny" and the id from the person that tried to access. I have tried the following code, but i get "Unsupported observationType", how could i make this work? Could someone refer me to some json documentation to achieve this. SOS version is 2.0 Thank you
 "version" : "1.1.0",
  "exceptions" : [
    {
      "code" : "InvalidRequest",
      "text" : "Unsupported observationType: http://www.opengis.net/def/observationType/OGC-OM/2.0/SWEArrayObservation"
    }
  ]
}
{
  "request": "InsertObservation",
  "service": "SOS",
  "version": "2.0.0",
  "offering": "http://www.safe-ech.es/1.0/offering/809",
  "observation": {
   
    "identifier": {
      "value": "http://http://www.safe-ech.es/1.0/observation/809",
      "codespace": "http://www.opengis.net/def/nil/OGC/0/unknown"
    },
    "type": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation",
    "procedure": "http://www.safe-ech.es/1.0/procedure/809",
    "observedProperty": "http://www.safe-ech.es/1.0/acc_estado_evento",
    "featureOfInterest": {
      "identifier": {
        "value": "http://http://www.safe-ech.es/1.0/featureOfInterest/809",
        "codespace": "http://www.opengis.net/def/nil/OGC/0/unknown"
      },
      "name": [
        {
          "value": "Access 101",
          "codespace": "http://www.opengis.net/def/nil/OGC/0/unknown"
        }
      ],
      "sampledFeature": [
        "http://http://www.safe-ech.es/1.0/featureOfInterest/Residence"
      ],
      "geometry": {
        "type": "Point",
        "coordinates": [
          39.1,
          0.22
        ],
        "crs": {
          "type": "name",
          "properties": {
            "name": "EPSG:4326"
          }
        }
      }
    },
    "phenomenonTime": "2017-01-30T13:06:44+01:00",
    "resultTime": "2017-01-30T13:06:44+01:00",
    "result": [
      "100",
      "Allow"
    ]
  }
}
Reply | Threaded
Open this post in threaded view
|

Re: JSON insertObservation SWEArrayObservation

Carsten Hollmann
Hi Tony,

the JSON encoded SWEArrayObservation is not yet supported in the 52N-SOS.
If the SWEArrayObservation is required for you to insert the values, you
should use the XML binding/encoding.

A note regarding the JSON binding/coding. The JSON binding/coding
implementation of the 52N-SOS is not yet specified but it is based as
much as possible on the abstract definitions of the specifications.

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
Reply | Threaded
Open this post in threaded view
|

Re: JSON insertObservation SWEArrayObservation

Toni Aparici
Thank you Carsten,

I'll give a try to the XML encoding.

While i was serching for an answer i saw this place https://github.com/peterataylor/om-json in case someone needs.


Anyway, may be someone else knows some trick to insert an observation with two parameters in json with the current implementation.