Filter by category_id

The POI example shows how to filter by category_id, which is an array of Int. How do I know which value to pick to filter for bakeries, for example.

Yeah, that’s a little painful. It’s only written here:

1 Like

@t2null,

You can also request this list from the pois enpoint, using this body:

{"request":"list"}

Best regards

Where is the webpage with the full list of CATEGORIES and all the other attribute lists ?

@alanscot,
the 2 ways to see the full list of categories has been described in the previous 2 posts.
There is no dedicated webpage to viewing all categories in a different way.

Hi,
I have a couple of questions about openpoiservice categories

  1. Where in github can I see how the category ids are translated into osm tags?
  2. Is there a way to extend the categories? I am missing places (osm key places) categories, like city, village, hamlet
  3. Or can I use an osm key/tag

Thanks
Mats

Well, if you check OSM Wiki, you can see that it’s pretty much a direct mapping (except the spaces are replaced by underscores). So that is what I assumed, and it works well for me based on that assumption

Those are places, not Points Of Interest. I would not expect those in a POI-service to be honest, but in a geolocation-service.

Whether you can directly use osm tags, I’m not sure, I don’t think so.

Thanks Stefan
I can see that there is a limit on 5 category ids in a POI search. Is there a way of expanding it to more than 5? Or do I have to do split my categories into sets of 5 and create multiple calls and merge the results?

Yes, that’s a server limit, so you can’t change that (unless you host yourself and change the code).
But you can also use category_group_ids: that’s the id on the top branches of the tree. Then you’ll get everything below it. I’m not sure, since I don’t use it that way, but I think the limit for category_group_ids is also 5 (Personally I also limit my number of returned results…). If that is still not enough for you, then yes, you’ll need to combine.

But if that is the case, be aware you’ll get a lot of points returned depending on where you search. So you might want to look at simply using Overpass to select features from Openstreetmap directly. It really depends on what you want (everything, it seems…). To me it does not make sense to get everything, because I’m usually looking for something specific. And if everything is shown on the map, it’ll only clutter it to the point of unreadability (like the maps from the famous big search provider, for example…)

1 Like