UDST / urbanaccess

A tool for GTFS transit and OSM pedestrian network accessibility analysis by UrbanSim
https://udst.github.io/urbanaccess/index.html
GNU Affero General Public License v3.0
241 stars 57 forks source link

Feature/networkx helpers #91

Open PyMap opened 2 years ago

PyMap commented 2 years ago

@sablanchard, this PR includes:

  1. Directed or Undirected MultiGraph parameter implementation for the ua_to_networkx method.
  2. get_node_relations_by_type to get self-loop and multi-edges relations in the urbanaccess_nw object (this pretends to help users to have a better understanding before networkx object instantiation)
  3. network_degree_stats to get sum and average node degree of the networkx object.
  4. from_parallel_to_single_edges to go from multi to single edges.

All of them are shown in the networkx_helpers demo notebook

PyMap commented 2 years ago

@sablanchard I found this methods

https://github.com/gboeing/osmnx/blob/main/osmnx/utils_graph.py#L318-L418

that are used to go from parallel to single edges.

I'm proposing something similar here https://github.com/UDST/urbanaccess/blob/feature/networkx-helpers/urbanaccess/utils.py#L657-L710

... just sharing to add some conext to the proposal.