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.
index_to_way: a dictionary which maps the index of an edge of the underlying OSMGraph.graph to the OSMGraph.Way it represents.
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.)
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?
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.index_to_way
: a dictionary which maps the index of an edge of the underlyingOSMGraph.graph
to theOSMGraph.Way
it represents.sorted_edges
: a vector whose indices correspond toOSMGraph.graph.edges
and maps to the indices of its start and end nodesOSMGraph.graph.vertices
. (This field could also be namededge_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 theOSMGraph
type. However, I'm not so sure aboutsorted_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?