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

suggest data given bounding box #201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

dhodcz2
Copy link

@dhodcz2 dhodcz2 commented Jul 21, 2022

I am working on a project which uses pyrosm to get static .PBF files and need this functionality rather than manually determining the .PBF files for each location. I believe this implementation allows for the use cases mentioned in #165 and #197.

`suggest = Suggest()
chicago = shapely.geometry.box(-87.629, 41.878, -87.614, 41.902)
abuja = shapely.geometry.box(7.5, 9.5, 7.6, 9.6)

suggest.continents(chicago)
Out[2]: array(['north-america'], dtype=object)
suggest.cities(chicago)
Out[3]: array(['chicago'], dtype=object)
suggest.cities(chicago, url=True)
Out[4]:
array(['https://download.bbbike.org/osm/bbbike/Chicago/Chicago.osm.pbf'],
dtype=object)
suggest.continents(abuja)
Out[5]: array(['africa'], dtype=object)
suggest.subregions(abuja)
Out[6]: array([], dtype=object)
suggest.regions(abuja, url=True)
Out[7]:
array(['http://download.geofabrik.de/africa/nigeria-latest.osm.pbf'],
dtype=object)
`

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

Successfully merging this pull request may close these issues.

None yet

1 participant