This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Pyrosm python package: how to filter?

0

Hello,

I'm using the pyrosm package in python and I read with it a bdf file for Bristol city. I want to filter and query all the shops and couple of amenities. However, every time I filter only for all shops I've 3,367 records. When I filter for all shops and some amenities, instead of having more records I have less (2,059). It seems in the data that I miss some of the shops. Below my code.

from pyrosm import OSM
osm_path ='bristol-latest.osm.pbf' # downloaded from geofabrik
osm = OSM(osm_path)
custom_filter = {"shop":True, "amenity":["bar", "cafe", "fast_food", "ice_cream", "pub", "cinema"]}
pois = osm.get_pois(custom_filter=custom_filter)

Any idea what's wrong please?

Thank you.

asked 19 Feb '21, 15:21

Katerina_Kourou's gravatar image

Katerina_Kourou
26445
accept rate: 0%

edited 19 Feb '21, 15:57

MarcoR's gravatar image

MarcoR
6873820

Source code available on GitHub .