I'm not sure if this is caused by an issue with my environment or the input files I've downloaded, but I'm getting this with the public Geofabrik .osm.pbf
extracts as well as the internal (with metadata) .osm.pbf
and .osh.pbf
extracts downloaded from https://osm-internal.download.geofabrik.de/north-america/us/minnesota.html
(venv) [afranco@MIDD-13822 python-osmium-examples (installation-fixes)]$ python3 highway_mappers.py minnesota-internal.osh.pbf mn-highway-mappers.csv
processing minnesota-internal.osh.pbf
Stage 1: Counting Unique Highway Mappers
Way w4384659: nodes=[26759799,26759798,26759797,26759796,26759794,26...] tags={created_by=YahooApplet 1.0,highway=motorway,nam...}
Traceback (most recent call last):
File "highway_mappers.py", line 69, in <module>
cli()
File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "highway_mappers.py", line 56, in cli
mch.apply_file(osmfile)
File "highway_mappers.py", line 27, in way
if w.mapper not in self.mappers:
AttributeError: 'osmium.osm._osm.Way' object has no attribute 'mapper'
It looks like I have the latest 3.2.0 release of osmium:
(venv) [afranco@MIDD-13822 python-osmium-examples (installation-fixes)]$ ls venv/lib/python3.8/site-packages/
__pycache__/ numpy/ pytz/
certifi/ numpy-1.22.1.dist-info/ pytz-2021.3.dist-info/
certifi-2021.10.8.dist-info/ osmium/ requests/
charset_normalizer/ osmium-3.2.0.dist-info/ requests-2.27.1.dist-info/
charset_normalizer-2.0.10.dist-info/ pandas/ setuptools/
click/ pandas-1.4.0.dist-info/ setuptools-41.2.0.dist-info/
click-8.0.3.dist-info/ pip/ six-1.16.0.dist-info/
dateutil/ pip-19.2.3.dist-info/ six.py
easy_install.py pkg_resources/ urllib3/
idna/ python_dateutil-2.8.2.dist-info/ urllib3-1.26.8.dist-info/
idna-3.3.dist-info/ python_osmium_examples-0.1.0-py3.8.egg-info/
Thoughts as to what to investigate?