-
Notifications
You must be signed in to change notification settings - Fork 827
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
Support directed bearing/orientation distributions and plots #1137
Comments
This would be easy enough to implement but I want to make sure that it's theoretically sound first. I think it may be, though users may need a warning to ensure things proceed according to expectations. That is, should we allow the calculation of bearings on directed graphs? If a user is interested in the bearings/orientation of flows, then maybe yes. If the user is interested in the bearings/orientation of physical infrastructure, then no. Perhaps a UserWarning as such is sufficient if a user passes a MultiDiGraph instead of a MultiGraph. |
Thanks @gboeing for your insights here.
That is a helpful conceptual distinction, although there is certainly a relation between physical infrastructure and flow. Some examples are waterways, separated highways, one ways trails (common in mountain biking, skiing, etc). In all these cases, the physical infrastructure is designed to support directional flow.
Another option would be to keep the "graph must be undirected" error unless the user sets an additional argument like The warning proposal also sounds good paired with documentation like: "Supplying a One final note, I initially come to this repository with the hopes of using the bearing calculation and polar histogram plotting without wanting to use a networkx graph. But many of the critical functions required a graph input. Putting the data into the graph was not too hard, but for me was solely for purposes of using the mature and powerful bearing/plotting functionality. |
Would you like to open a PR (targeting the v2 branch) to allow directed graphs, issue a UserWarning and update the docstring? |
Okay will do! Nice to see the type annotations for v2... will make contributing easier. |
Closed by #1139 |
What problem does your feature proposal solve?
Creating orientation/bearing distributions and plots for directed graphs.
What is your proposed solution?
_extract_edge_bearings
can support directed graphs and in the case of a directed graph skip adding reverse bearings (bearings_r
):osmnx/osmnx/bearing.py
Lines 148 to 191 in 78af8ed
What alternatives have you considered?
Implementing bearing calculation, distributions, and plotting outside of osmnx and networkx, but would like to avoid such duplication.
Additional context
Possible use cases are one-way transportation networks or downhill ski trails.
The text was updated successfully, but these errors were encountered: