gboeing / osmnx

OSMnx is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap.
https://osmnx.readthedocs.io
MIT License
4.84k stars 822 forks source link

add `buffer_geometry` helper function to `utils_geo` module #1214

Closed gboeing closed 3 weeks ago

gboeing commented 1 month ago

This new function offers users a small quality-of-life improvement for use cases like:

For example, to download a graph within a 500 meter buffer of a city's boundaries:

import osmnx as ox
geom = ox.geocoder.geocode_to_gdf("Piedmont, CA, USA").iloc[0]["geometry"]
G = ox.graph.graph_from_polygon(ox.utils_geo.buffer_geometry(geom, 500), network_type="drive")
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.31%. Comparing base (94b7e73) to head (95846f2). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1214 +/- ## ======================================= Coverage 98.31% 98.31% ======================================= Files 24 24 Lines 2369 2374 +5 ======================================= + Hits 2329 2334 +5 Misses 40 40 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.