GIScience / openpoiservice

:round_pushpin: Openpoiservice is a flask application which hosts a highly customizable points of interest database derived from OpenStreetMap data.
https://openrouteservice.org
Apache License 2.0
173 stars 22 forks source link

Using "sortby":"category" results in an internal server error #120

Closed koebi closed 2 years ago

koebi commented 2 years ago

This problem has been reported by a user in the ask-forum and can be reproduced via the playground: Screenshot 2022-01-10 at 09-32-20 Pois Post ORS API

Removing sortby or switching to distance makes the problem disappear.

koebi commented 2 years ago

This problem seems to have existed for a bit…

I think the problem is that the query used for requesting pois is https://github.com/GIScience/openpoiservice/blob/0bc26a9f46b4e9972b90a3d446fe2ce5d842b72a/openpoiservice/server/api/query_builder.py#L76-L79

which does not include any information about categories. When defining what to sort by, however, it tries to use the category column from the query above, which does not exist:

https://github.com/GIScience/openpoiservice/blob/0bc26a9f46b4e9972b90a3d446fe2ce5d842b72a/openpoiservice/server/api/query_builder.py#L89

I don't know how to fix this though…

koebi commented 2 years ago

Was fixed in #121.