Comments (5)
Closed by #1139
from osmnx.
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.
from osmnx.
Thanks @gboeing for your insights here.
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.
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.
Perhaps a UserWarning as such is sufficient if a user passes a MultiDiGraph instead of a MultiGraph.
Another option would be to keep the "graph must be undirected" error unless the user sets an additional argument like directed_bearings=True
or omit_reverse=True
.
The warning proposal also sounds good paired with documentation like: "Supplying a MultiDiGraph
results in directional bearings. For bidirectional bearings, use MultiDiGraph.to_undirected()
".
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.
from osmnx.
Would you like to open a PR (targeting the v2 branch) to allow directed graphs, issue a UserWarning and update the docstring?
from osmnx.
Would you like to open a PR (targeting the v2 branch) to allow directed graphs
Okay will do!
Nice to see the type annotations for v2... will make contributing easier.
from osmnx.
Related Issues (20)
- Feature Request: Adding Buffer Zone Function to OSMnx HOT 1
- Node Identification within Buffer Zone (if buffer was to be implemented) HOT 1
- PermissionError [ErrNo 13] when connecting to localhost using the latest docker image HOT 2
- Contributing guidelines link nowhere HOT 2
- Document usage limitations HOT 10
- UnicodeDecodeError in graph_from_xml on Windows Installations HOT 4
- Calling graph_from_place("Alaska", network_type="drive") throws GEOSException: TopologyException HOT 4
- Vasu HOT 1
- Unable to plot superimposed image HOT 1
- street networks graphs not working HOT 3
- AttributeError: module 'osmnx' has no attribute 'clean_intersections' HOT 2
- Removal of inner_polygons from outer_polygons (creation of holes), creates maximum one hole. HOT 5
- Include parking space data in nodes HOT 7
- Fill missing values with most common value on similar roads HOT 4
- OSMnx 2.0 Migration Guide HOT 3
- Add junction/intersection types to nodes HOT 6
- Support loading and/or merging multiple networks HOT 5
- [Meta] Enable Discussions tab on this GitHub repo HOT 1
- Further API streamlining for v2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osmnx.