UrbanBox (modeled as Device) to FlowerBed assignation:
[
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-3",
"type": "FlowerBed",
"refDevice": "0018b20000020a7d"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-4",
"type": "FlowerBed",
"refDevice": "0018b20000020a80"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-5",
"type": "FlowerBed",
"refDevice": "0018b20000020a6a"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-6",
"type": "FlowerBed",
"refDevice": "0018b20000020a83"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-7",
"type": "FlowerBed",
"refDevice": "0018b20000020972"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-8",
"type": "FlowerBed",
"refDevice": "0018b20000020a81"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-2",
"type": "FlowerBed",
"refDevice": "0018b20000020a35"
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-1",
"type": "FlowerBed",
"refDevice": "0018b20000020a7c"
}
]
The information above can be found at the LoRa platform managed by SIG at:
https://lora-ns.sig-ge.ch/mydevices_list.html
FlowerBed (clusters of flowers):
This map describes their position:
The interactive map can be found at:
https://s.geo.admin.ch/8d5ffe8a16
Their location are fixed at:
[
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-3",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.18777345077501, 6.141221902014418",
"46.18776394428967,6.1412558085139075",
"46.187460562531,6.141082986525166",
"46.18747273747444,6.141046425800975",
"46.18777345077501,6.141221902014418"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-4",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.18159456349196,6.1409987953921235",
"46.181588625021845,6.141030022537279",
"46.18139270253789,6.140969933509893",
"46.18139855159107,6.140930937248621",
"46.18159456349196,6.1409987953921235"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-5",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.181615723284146,6.140883015227287",
"46.181614058518115,6.140894712009585",
"46.18131811980222,6.1408214662397675",
"46.18132405821452,6.140790239226948",
"46.181619996950765,6.140863484835084",
"46.181615723284146,6.140883015227287"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-6",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.189423842171415, 6.13594646813324",
"46.189471839237186, 6.1360515432406455",
"46.189511939908066, 6.136018197634609",
"46.189232409898864, 6.135418636893407",
"46.18919332854337, 6.135462321658967",
"46.189423842171415, 6.13594646813324"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-7",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.185130470398505, 6.140464991190295",
"46.18513395867176, 6.1405335596375386",
"46.18508999065603, 6.1405436758278995",
"46.18508470351761, 6.140475150355029",
"46.185130470398505, 6.140464991190295"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-8",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.18417719481858, 6.1394048712655955",
"46.18418137433464, 6.139455287863608",
"46.18414308644842, 6.139489879659276",
"46.18412512757313, 6.139492899043365",
"46.18412211601563, 6.139465769842075",
"46.18417719481858, 6.1394048712655955"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-2",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.18374322214299,6.136568203412297",
"46.18376742201472, 6.1368720158459675",
"46.1837387297771, 6.13688047399718",
"46.183561454034184, 6.136799226881401",
"46.18354104365161, 6.13658988021811",
"46.18374322214299, 6.136568203412297"
],
"metadata": {}
}
},
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-1",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.18418608298799,6.140411101107388",
"46.18399689316645,6.140545143921089",
"46.184056735085676,6.140663530473896",
"46.18416543042762,6.1405709147437815",
"46.18418608298799,6.140411101107388"
],
"metadata": {}
}
}
]
Querying flowerbed using location (geo-queries):
We can query closest flower bed using position (e.g. truck position). For the flower beds 4 and 5:
test 1. Using the "camion" position shown in the right, querying with a max distance of 7 meters:
request:
curl --location --request GET 'http://5.53.108.182:1026/v2/entities/?type=FlowerBed&georel=near;maxDistance:7&geometry=point&coords=46.18153,6.14105&attrs=location' \
--header 'Fiware-Service: carouge'
response:
[
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-4",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.18159456349196,6.1409987953921235",
"46.181588625021845,6.141030022537279",
"46.18139270253789,6.140969933509893",
"46.18139855159107,6.140930937248621",
"46.18159456349196,6.1409987953921235"
],
"metadata": {}
}
}
]
test 2. Using the "camion" position shown in the left, querying with max distance of 7 meters:
curl --location --request GET 'http://5.53.108.182:1026/v2/entities/?type=FlowerBed&georel=near;maxDistance:7&geometry=point&coords=46.18160,6.14090&attrs=location' \
--header 'Fiware-Service: carouge'
[
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-5",
"type": "FlowerBed",
"location": {
"type": "geo:polygon",
"value": [
"46.181615723284146,6.140883015227287",
"46.181614058518115,6.140894712009585",
"46.18131811980222,6.1408214662397675",
"46.18132405821452,6.140790239226948",
"46.181619996950765,6.140863484835084",
"46.181615723284146,6.140883015227287"
],
"metadata": {}
}
}
]