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

AttributeError: module 'osmnx' has no attribute 'project_gdf'. Did you mean: 'project_graph'? #132

Open
nigelsim opened this issue Jan 12, 2025 · 1 comment

Comments

@nigelsim
Copy link

When trying to run prettymaps recently I got the following error after a successful install:

  File "<stdin>", line 1, in <module>
  File "/home/nigel/.cache/pypoetry/virtualenvs/badlands-SJrMlJjj-py3.11/lib/python3.11/site-packages/prettymaps/draw.py", line 916, in plot
    gdfs = get_gdfs(query, layers, radius, dilate, -rotation)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nigel/.cache/pypoetry/virtualenvs/badlands-SJrMlJjj-py3.11/lib/python3.11/site-packages/prettymaps/fetch.py", line 197, in get_gdfs
    perimeter = get_perimeter(
                ^^^^^^^^^^^^^^
  File "/home/nigel/.cache/pypoetry/virtualenvs/badlands-SJrMlJjj-py3.11/lib/python3.11/site-packages/prettymaps/fetch.py", line 100, in get_perimeter
    perimeter = get_boundary(query, radius, circle=circle, rotation=rotation)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nigel/.cache/pypoetry/virtualenvs/badlands-SJrMlJjj-py3.11/lib/python3.11/site-packages/prettymaps/fetch.py", line 58, in get_boundary
    boundary = ox.project_gdf(
               ^^^^^^^^^^^^^^
AttributeError: module 'osmnx' has no attribute 'project_gdf'. Did you mean: 'project_graph'?

Appears to be osmnx is now at 2.0.1, and the dependencies in prettymaps are for >1.9. In version 2 the project_gdf method has been removed, but forcing the dependency back to 1.9.3 (or, <2 in my case using Poetry) resolves the issue.

@nigelsim
Copy link
Author

I just noticed PR #130 fixes this.

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