Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when modifying the example code for Basic Usage:Read street networks #229

Open
brunobelorte opened this issue Mar 1, 2024 · 0 comments

Comments

@brunobelorte
Copy link

brunobelorte commented Mar 1, 2024

Describe the bug
Well, I did a test using the tutorial presented on the page "Read street networks"
and, when opening the sudeste-latest.osm.pbf file, I received an error from the library

To Reproduce
Steps to reproduce the behavior:

from pyrosm import OSM
from pyrosm import get_data

fp = get_data("sudeste", directory="/home/brunob/mapas")


osm = OSM(fp)

drive_net = osm.get_network(network_type="driving")
drive_net.plot()

and so

 Traceback (most recent call last):
 File "/home/brunob/códigos/plotando_mapa.py", line 18, in <module>
 drive_net = osm.get_network(network_type="driving")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/brunob/.local/lib/python3.11/site-packages/pyrosm/pyrosm.py", line 249, in get_network
 edges, node_gdf = get_network_data(
                       ^^^^^^^^^^^^^^^^^
File "/home/brunob/.local/lib/python3.11/site-packages/pyrosm/networks.py", line 18, in get_network_data
nodes, ways, relation_ways, relations = get_osm_data(
                                            ^^^^^^^^^^^^^
File "pyrosm/data_manager.pyx", line 175, in pyrosm.data_manager.get_osm_data
File "pyrosm/data_manager.pyx", line 176, in pyrosm.data_manager.get_osm_data
File "pyrosm/data_manager.pyx", line 172, in pyrosm.data_manager._get_osm_data
File "pyrosm/data_manager.pyx", line 130, in pyrosm.data_manager.get_osm_ways_and_relations
File "pyrosm/data_manager.pyx", line 95, in pyrosm.data_manager.get_way_arrays
File "pyrosm/_arrays.pyx", line 93, in pyrosm._arrays.convert_to_arrays_and_drop_empty
File "pyrosm/_arrays.pyx", line 79, in pyrosm._arrays.convert_to_arrays_and_drop_empty
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Expected behavior
The expected behavior was to plot the highway map

Environment:

  • OS: Ubuntu 22.04.3 LTS (GNU/Linux 6.5.0-18-generic x86_64)
  • Python package source
  • python 3.11.5, pyrosm 0.6.2, osmnx 1.9.1
@brunobelorte brunobelorte changed the title Error when modifying the base code for "working with graphs" Error when modifying the base code for Basic Usage:Read street networks Mar 1, 2024
@brunobelorte brunobelorte changed the title Error when modifying the base code for Basic Usage:Read street networks Error when modifying the example code for Basic Usage:Read street networks Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant