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

Add fields to OSMGraph type: index_to_way, sorted_edges #60

Open
fbanning opened this issue Jan 12, 2022 · 0 comments
Open

Add fields to OSMGraph type: index_to_way, sorted_edges #60

fbanning opened this issue Jan 12, 2022 · 0 comments

Comments

@fbanning
Copy link
Contributor

fbanning commented Jan 12, 2022

I'm currently building a plotting package for LightOSM maps and in this process it has occurred to me that it would be handy to have one (possibly two) additional fields in the OSMGraph type.

  1. index_to_way: a dictionary which maps the index of an edge of the underlying OSMGraph.graph to the OSMGraph.Way it represents.
  2. sorted_edges: a vector whose indices correspond to OSMGraph.graph.edges and maps to the indices of its start and end nodes OSMGraph.graph.vertices. (This field could also be named edge_to_vertices or something like that.)

This is how I've currently implemented it for my needs:
https://github.com/fbanning/OSMMakie.jl/blob/77052b22853f57e03d3712094075c46195d6f987/src/recipe.jl#L35-L46

I think that index_to_way could be very handy to be made available to all users as a field of the OSMGraph type. However, I'm not so sure about sorted_edges because it's solely concerned with the node and edge indices of the underlying graph and doesn't work with any OSM data at all.

Would like to hear your opinions on these extensions of OSMGraph. If you're feeling positive about it, would you accept a PR if I make one?

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

No branches or pull requests

1 participant