GIScience/openpoiservice

Returned categories list differs from categories.yml specification

aoles opened this issue · 4 comments

aoles commented

Categories list returned by the following query to openruteservice pois API differs in structure from the definition. For example, animals: children: amenity and animals: children: shop contain 103 and 123 (!) elements, respectively.

curl -X POST https://api.openrouteservice.org/pois?api_key=<ORS_API_KEY> \
  -H 'content-type: application/json' -d '{"request": "list"}' > categories_json.txt

OUTPUT: categories_json.txt 🔍 VIEW ONLINE

aoles commented

If the intention is to return a 1:1 json version of the yaml definition consider direct conversion similar to https://gist.github.com/mboersma/1329669.

The intention here is not to return a 1:1 json version: what happens is that all tags of a category amenity for example are grouped together into one parent with their corresponding IDs which makes it very easy to find while looping over the pbf files. What we could do is add the information of the "top-level" group which has got nothing to do with OSM itself, it's just trying to create a "topic", such as arts_and_culture or facilities - I will create a separate issue for this.

aoles commented

Thanks @TimMcCauley for getting back to me on this.

I get that the grouping to different categories is subjective and not based on OSM. I still don't get the structure of the result of request=list, though. If it's not supposed to return a tag grouping as defined by https://github.com/GIScience/openpoiservice/blob/master/openpoiservice/server/categories/categories.yml then what's it's actual logic then?

Did you have a look at animals: children: amenity on https://codebeautify.org/jsonviewer/cb830dc5? The grouping of all these amenities under a common animals tag puzzles me, I can hardly believe this was meant this way.

Thanks for pointing it out again - I now understand and solved the issue in fde0548