Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for automatic dict and set attributes in module
io
#1075Add support for automatic dict and set attributes in module
io
#1075Changes from 2 commits
1e956a1
1393789
c518569
22b7193
e588260
f28d8b9
2b99561
3dd168b
972d0e9
7a024ac
2e3e8af
bdf1521
3ff4730
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We previously only ran
literal_eval
on edge attributes. Is there a use case for node attributes? OSMnx does not produce any node attributes of type list, dict, or set.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can describe my usage, if it makes sense to you. It's clearly all custom attributes, as I mentioned in the issue description, so not necessarily OSMnx scope.
I'm doing 15-minute city metrics, based on OSMnx with a lot of my own code on top. I fetch a walking network via OSMnx, then integrate amenity POI nodes into it, adding linking edges with lengths. The network nodes, apart from the amenities, are considered to be "residential locations", without getting into filtering details. Processing then obtains, among other things, shortest path distances, per residential node, to each amenity node. These are stored per node into a dict of dicts attribute keyed by amenity category and amenity node.
Accessible amenities are counted per residential node and edge, also, which allows for producing isochrone buffered geometries, for example.
It's true that I could have managed these outside the graph object using dicts, but I had wanted to make the work graph-oriented, and I believe it simplifies things, avoiding the need to keep separate objects consistent when doing things like truncating, etc, etc.