telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md
GNU Affero General Public License v3.0
210 stars 265 forks source link

geo:json Mulitpoint, MultilineString, Multipolygon non documented #3586

Closed gboege closed 4 years ago

gboege commented 4 years ago

Hi

I have just found out, that there are more geo:json options available than documented. They are implemented and in the tests, but not in the docu. Multipoint Multilinestring Mulitpolygon

I guess, this opens up new options and usecases.

fgalan commented 4 years ago

To which documentation do you refer? Could you provide the precise link, please? Thanks!

gboege commented 4 years ago

I have to correct myself a bit, it is not non documented. Sorry for this unprecise statement, maybe this could be a bit extended to explicitely mention those 3. I did searches for all 3 terms with fiware and no results.

https://fiware-orion.readthedocs.io/en/1.2.1/user/geolocation/index.html No mentioning at all.

http://telefonicaid.github.io/fiware-orion/api/v2/stable/ "GeoJSON. GeoJSON is a geospatial data interchange format based on the JavaScript Object Notation (JSON). GeoJSON provides greater flexibility allowing the representation of point altitudes or even more complex geospatial shapes, for instance multi geometries." -> I misunderstood multi geometries as Polygon, did not recognise that the 3 above Geometries are existing and covered. My fault, sorry.

Maybe adding a list of Geojson geometries might be helpful, especially when not all Geojson is covered (as far as I know: Features and FeatureCollection).

fgalan commented 4 years ago

I have to correct myself a bit, it is not non documented. Sorry for this unprecise statement, maybe this could be a bit extended to explicitely mention those 3. I did searches for all 3 terms with fiware and no results.

https://fiware-orion.readthedocs.io/en/1.2.1/user/geolocation/index.html No mentioning at all.

(1.2.1 is a pretty old version, I'd recommend to use https://fiware-orion.readthedocs.io/en/master/user/geolocation/index.html or https://fiware-orion.readthedocs.io/en/2.3.0/user/geolocation/index.html)

Both topics (entity location and geographical queries) are dealt in detail in the "Geospacial properties of entities" and "Geographical Queries" sections of the NGSIv2 specification.

with actually is a link to the second link you cite, i.e. http://telefonicaid.github.io/fiware-orion/api/v2/stable

http://telefonicaid.github.io/fiware-orion/api/v2/stable/ "GeoJSON. GeoJSON is a geospatial data interchange format based on the JavaScript Object Notation (JSON). GeoJSON provides greater flexibility allowing the representation of point altitudes or even more complex geospatial shapes, for instance multi geometries." -> I misunderstood multi geometries as Polygon, did not recognise that the 3 above Geometries are existing and covered. My fault, sorry.

Maybe adding a list of Geojson geometries might be helpful, especially when not all Geojson is covered (as far as I know: Features and FeatureCollection).

NGSIv2 intentionally doesn't provide extra info regarding which GeoJSON are supported in each particular implementation because that is something up to the implementation. In the case of Orion, the GeoJson capabilities are at the end the onese in the underlaying MongoDB database. Mabye some information regarding this information could be added to the "implementation notes" at http://fiware.github.io/specifications/ngsiv2/stable/

To be fully sure, could you tell how do have tested the non-working case of Features and Features Collection? Could you provide a curl or similar to reproduce your test, please?

Thanks!

gboege commented 4 years ago

I do understand that it is not mentioned in the NGSI-Standard, but I agree to better put it in the implementation notes, because it is not the full GeoJson standard implemented:

The following GeoJson Positions (as described in the table of index here are enclosed in the Orion-Tests (Link) and could be replicated by me: geo:json Point geo:json MultiPoint geo:json LineString geo:json MultiLineString geo:json Polygon geo:json MultiPolygon

OK: Point curl -X "POST" "http://xx.xx.xx.xx:1026/v2/entities" \ -H 'Content-Type: application/json' \ -H 'Fiware-Service: /' \ -H 'Fiware-servicepath: /' \ -d $'{ "type": "Testtype", "id": "Testentity", "location": { "type": "geo:json", "value": { "type": "Point", "coordinates": [ 0, 0 ] }, "metadata": { "crs": { "value": "WGS84" } } } }'

Not OK: Feature - Database Error &#40: curl -X "POST" "http://xx.xx.xx.xx:1026/v2/entities" \ -H 'Content-Type: application/json' \ -H 'Fiware-Service: /' \ -H 'Fiware-servicepath: /' \ -d $'{ "type": "Testtype", "id": "Testentity", "location": { "type": "geo:json", "value": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0, 0 ] }, "properties": { "name": "null island" } }, "metadata": { "crs": { "value": "WGS84" } } } }'

Not OK: GeometryCollection - Database Error &#40: curl -X "POST" "http://xx.xx.xx.xx:1026/v2/entities" \ -H 'Content-Type: application/json' \ -H 'Fiware-Service: /' \ -H 'Fiware-servicepath: /' \ -d $'{ "type": "Testtype", "id": "Testentity", "location": { "type": "geo:json", "value": { "type": "Feature", "geometry": { "type": "GeometryCollection", "geometries": [ { "type": "Point", "coordinates": [ 0, 0 ] }, { "type": "LineString", "coordinates": [ [ 0, 0 ], [ 1, 0 ] ] } ] }, "properties": { "name": "null island" } }, "metadata": { "crs": { "value": "WGS84" } } } }'

Not OK: FeatureCollection - Database Error &#40: curl -X "POST" "http://xx.xx.xx.xx:1026/v2/entities" \ -H 'Content-Type: application/json' \ -H 'Fiware-Service: /' \ -H 'Fiware-servicepath: /' \ -d $'{ "type": "Testtype", "id": "Testentity", "location": { "type": "geo:json", "value": { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0, 0 ] }, "properties": { "name": "null island" } } ] }, "metadata": { "crs": { "value": "WGS84" } } } }'

fgalan commented 4 years ago

Thanks for the feedback! Based on it I have done the following PR modifying documentation: https://github.com/telefonicaid/fiware-orion/pull/3587. It would be great if you could have a look to it, please.

Thanks!

fgalan commented 4 years ago

Taking into account PR #3587, I think this issue can be closed. Do you agree, @gboege ?

gboege commented 4 years ago

We updated the Orion CB docs with details. Issue closed