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

deprecate buffer_dist and clean_periphery arguments #1044

Merged
merged 6 commits into from
Jul 25, 2023
Merged

deprecate buffer_dist and clean_periphery arguments #1044

merged 6 commits into from
Jul 25, 2023

Conversation

gboeing
Copy link
Owner

@gboeing gboeing commented Jul 25, 2023

This PR:

  • deprecates the buffer_dist function parameter in the graph, features, and geocoder modules. It is seldom used, it clutters the codebase, and its functionality is easily reproduced by the user with ~1 line of code.
  • deprecates the clean_periphery function parameter in the graph module: the equivalent of clean_periphery=True will the the uniform behavior going forward. This is the only way to generate an accurate graph on the perimeter, and the only way to get accurate stats, so it really makes no sense to have a False option here. See also (fix bug: streets per node is not calculated when clean_periphery=False #775).
  • updates the docs with some explanatory details regarding (now-standard) periphery cleaning

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.73%. Comparing base (a3aefcc) to head (b8407ca).
Report is 804 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1044      +/-   ##
==========================================
+ Coverage   97.71%   97.73%   +0.01%     
==========================================
  Files          26       26              
  Lines        2456     2467      +11     
==========================================
+ Hits         2400     2411      +11     
  Misses         56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gboeing gboeing merged commit ef6423b into main Jul 25, 2023
4 checks passed
@gboeing gboeing deleted the dep branch July 25, 2023 19:45
@EwoutH
Copy link
Contributor

EwoutH commented Mar 26, 2024

  • its functionality is easily reproduced by the user with ~1 line of code.

What would be the proper way to replace buffer_dist? (in this case with graph_from_place)

Edit: Would that be this example? Or can it be done more elegantly?

# or get the walking network within a 500 meter buffer of piedmont
polygon = ox.geocode_to_gdf("Piedmont, California, USA").loc[0, "geometry"]
poly_proj, crs_proj = ox.projection.project_geometry(polygon)
polygon, _ = ox.projection.project_geometry(poly_proj.buffer(500), crs=crs_proj, to_latlong=True)
G = ox.graph_from_polygon(polygon, network_type="walk")

@gboeing
Copy link
Owner Author

gboeing commented Mar 27, 2024

Yes that example does the job. My initial comment was overly conservative... it takes ~3 lines of code. Though it could be a single line of code for simpler use cases.

@gboeing
Copy link
Owner Author

gboeing commented Aug 22, 2024

See also the new buffer_geometry helper function added in #1214.

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.

2 participants