Details
-
Type: extRequest
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:None
-
HD-Enabler:Orion-LD
Description
Hi there,
Within the scope of research project powered by FIWARE in energy sector. We are going to have ontology include in our project therefore NGSI-ld is very well fit to our concept. But I faced some issues regarding usage of GeoProperty. Most important one is related to geolocation. There is no fresh document which can help me I found several links and info but none of works.
I posted :
curl -iX POST \
> 'http://IP:1026/ngsi-ld/v1/entities' \
> -H 'Content-Type: application/ld+json' \
> -d '
> {
> "id": "urn:ngsi-ld:ParkingSpot:santander:daoiz_velarde_1_5:5",
> "type": "ParkingSpot",
> "status":
{ > "type": "Property", > "value": "free", > "observedAt": "2018-09-21T12:00:00Z" > },
> "category":
{ > "type": "Property", > "value": [ > "onstreet" > ] > },
> "refParkingSite":
{ > "type": "Relationship", > "object": "urn:ngsi-ld:ParkingSite:santander:daoiz_velarde_1_5" > },
> "name":
{ > "type": "Property", > "value": "A-13" > },
> "location":
{ > "type": "Polygon", > "coordinates": [[ > [25.774,-80.190], > [18.466,-66.118], > [32.321,-64.757], > [25.774,-80.190] > ]] > },
> "@context": [
> "https://raw.githubusercontent.com/Maliheh-Haghgoo/N5GEH/master/Core-Context",
> "https://raw.githubusercontent.com/Maliheh-Haghgoo/N5GEH/master/Device.jsonld" ]
> }'
And I would like to query my entities based on location. Here is my Get request :
http://IP:1026/ngsi-ld/v1/entities/?type=Sensor&georel=within&geometry=polygon&coordinates=%20[[25.774,-80.190],[18.466,-66.118],[32.321,-64.757],[%2025.774,-80.190<http://IP:1026/ngsi-ld/v1/entities/?type=Sensor&georel=within&geometry=polygon&coordinates=%20%5b%5b25.774,-80.190%5d,%5b18.466,-66.118%5d,%5b32.321,-64.757%5d,%5b%2025.774,-80.190>]]
This is an error that I'm receiving :
{ "type": "http://uri.etsi.org/ngsi-ld/errors/InternalError", "title": "error filling a scope", "details": "invalid coordinates" }Actually with several tries it still does not work and I'm getting errors , I would appreciate it if you could help me in this regard.
Cheers,
-----------------------------------------------------------------------
Maliheh Haghgoo, M.Sc.
Research Associate
RWTH Aachen University
E.ON Energy Research Center, Institute for Automation of Complex Power Systems
Mathieustraße 10
52074 Aachen, Germany
Room 10.11
www.eonerc.rwth-aachen.de<http://www.eonerc.rwth-aachen.de/>
Phone: +49 241 80 49587
MHaghgoo@eonerc.rwth-aachen.de<MHaghgoo@eonerc.rwth-aachen.de>
__________________________________________________________________________________________
You can get more information about our cookies and privacy policies on the following links:
Fiware-tech-help mailing list
Fiware-tech-help@lists.fiware.org
To unsubscribe from Fiware-tech-help mailing list, go to the information page of the list at:
https://lists.fiware.org/listinfo/fiware-tech-help
[Created via e-mail received from: "Haghgoo, Maliheh" <mhaghgoo@eonerc.rwth-aachen.de>]
So, I looked into it.
First of all, what you want to do (query with a polygon inside another polygon) is not possible.
It is not possible because the mongodb geoqueries don't allow this complex combination and the orion/orionld context brokers use mongodb's already implemented geo-fencing functionality.
Hope it's OK to instead do queries combining points and polygons ...
For examples, see the following functional tests. The calls to "orionCurl" should be pretty self-explanatory:
https://github.com/FIWARE/context.Orion-LD/blob/develop/test/functionalTest/cases/0000_ngsild/ngsild_geoqueries-polygon.test