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

ENH: Calculate network distance and export to igraph #56

Merged
merged 33 commits into from
Oct 16, 2020
Merged

Conversation

HTenkanen
Copy link
Collaborator

@HTenkanen HTenkanen commented Oct 16, 2020

Relates to #52.

Adds functionality to:

  • calculate the length of network edges. Information is updated to column length (reported in meters with 3 decimals).
  • (optionally) return the nodes when parsing networks (notice: handling one-way/two-way streets are handled only when exporting the graph)
  • export the network into igraph.Graph (support for networkx/pandana are added next)

Example:

from pyrosm import OSM, get_data
from pyrosm.graphs import to_igraph
osm = OSM(get_data("helsinki"))
# Parse nodes and edges using `nodes=True`
nodes, edges = osm.get_network(nodes=True)
# Export to igraph
g = to_igraph(nodes, edges)

@HTenkanen HTenkanen merged commit c0ed464 into master Oct 16, 2020
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

Successfully merging this pull request may close these issues.

1 participant