GIScience/openpoiservice

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

koebi opened this issue · 2 comments

koebi commented

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

This problem seems to have existed for a bit…

I think the problem is that the query used for requesting pois is

bbox_query = db.session \
.query(POIs) \
.filter(*geom_filters) \
.subquery()

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:

sortby_group.append(bbox_query.c.category)

I don't know how to fix this though…

koebi commented

Was fixed in #121.