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.82k stars 821 forks source link

Change bounding box coordinates' order for v2.0.0? #1186

Closed gboeing closed 1 month ago

gboeing commented 2 months ago

What problem does your feature proposal solve?

Geographic bounding boxes usually follow the standard format of left, bottom, right, top (e.g., at OpenStreetMap and Shapely). For whatever reason, OSMnx instead expects them in the format of top, bottom, right, left (equivalent to north, south, east, west). I'm probably responsible for this oddity, but the reason behind it is lost to time. Currently, users have to read the docstring to know to use this non-standard format.

What is your proposed solution?

We should consider changing the expected bounding box format package-wide to the usual standard left, bottom, right, top in advance of the v2.0.0 release (which will have some breaking changes anyway).

Drawbacks: old code using the old format will break in v2.0.0.

Advantages: OSMnx will be aligned with global standards, creating less surprise for new users and eliminating a common source of unexpected bugs.

Additional context

I'd be grateful for any comments/feedback on whether the advantages are worth the drawbacks. It'd be an easy fix prior to the next beta release, if it's worth doing. FWIW, my current opinion is "yes."

EwoutH commented 1 month ago

I have thought about it for a while, but I'm in support of this. On the short term it will hurt, but on the long term it's clearly the preferred solution.

One major advantage is that you could directly pass a Shapely geometry with the .bounds method, which uses the order you propose.

gboeing commented 1 month ago

WIP in #1196