-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Hello,
I am trying to integrate a device with the maps widget on wirecloud.(mashups). I want to make sure that the data format is right
Is this the right syntax when provisioning a device?
sudo curl -iX POST \
'http://localhost:4041/iot/devices' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"devices": [
{
"device_id": "gps0022",
"entity_name": "urn:ngsi-ld:Gps:0022",
"entity_type": "Gps18",
"transport": "MQTT",
"timezone": "America/Sao_Paulo",
"attributes": [
**{ "object_id": "l", "name":"coordinates","type":"Point"}**
]
}
]
}'
I get this result:
{
"id":"urn:ngsi-ld:Gps:0023",
"type":"Gps18",
"TimeInstant":{
"type":"DateTime",
"value":"2020-12-10T16:33:13.366Z",
"metadata":{}
},
**"coordinates":{
"type":"Point",
"value":[10.2424,45.5642],**
"metadata":{"TimeInstant":{"type":"DateTime","value":"2020-12-10T16:33:13.366Z"}}}}
I have also tried the following:
**{ "object_id": "l", "name":"location","type":"Geojson"}**
then the result is:
{"id":"urn:ngsi-ld:Gps:0023","type":"Gps18","TimeInstant":{"type":"DateTime","value":"2020-12-10T17:58:21.706Z","metadata":{}},
**"location":{"type":"Geojson",
"value":[66.2424,45.5642],**
"metadata":{"TimeInstant":{"type":"DateTime","value":"2020-12-10T17:58:21.706Z"}}}}
**note: geo.json didn't work**
the geolocation attribute structure is different from the example the fiware documentation.
**"location": {
"type": "geo:json",
"value": {
"type": "Point",
"coordinates": [13.3986, 52.5547]
}
},**
Should the data be like this so I can integrate with the application map mashups? If so, how should I defined the attributes?
Note: I am not a JSON expert :D
thank you
Metadata
Metadata
Assignees
Labels
No labels