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

Coalesce non-GTFS network #162

Open
Ar-Kan opened this issue Oct 30, 2020 · 0 comments
Open

Coalesce non-GTFS network #162

Ar-Kan opened this issue Oct 30, 2020 · 0 comments

Comments

@Ar-Kan
Copy link

Ar-Kan commented Oct 30, 2020

Hello,

When I try to use the coalesce function on a path network from OSM the following error is raised:

KeyError                                  Traceback (most recent call last)
c:\Users\arqui\Documents\Repositorios\Identifying urban zones with spectral clustering\coalesse_poa.py in 
      81     # network_type='walk'
      82 )
----> 83 Gc = pt.toolkit.coalesce(G, 400)

~\anaconda3\envs\ox\lib\site-packages\peartree\toolkit.py in coalesce(G_orig, resolution, edge_summary_method, boarding_cost_summary_method)
    216     # such that we won't generate isolated nodes that become disconnected
    217     # from key coalesced nodes (because too many intermediary nodes)
--> 218     G = simplify_graph(G)
    219 
    220     # Extract all x, y values

~\anaconda3\envs\ox\lib\site-packages\peartree\toolkit.py in simplify_graph(G_orig)
    582         # If the path is not all one mode of travel, skip the
    583         # proposed simplification
--> 584         if not _path_has_consistent_mode_type(G, path):
    585             continue
    586 

~\anaconda3\envs\ox\lib\site-packages\peartree\toolkit.py in _path_has_consistent_mode_type(G, path)
    364         for i in range(edge_count):
    365             edge = G.edges[u, v, i]
--> 366             path_modes.append(edge['mode'])
    367     path_clear = all(x == path_modes[0] for x in path_modes)
    368     return path_clear

KeyError: 'mode'

Peartree version: 0.6.3
osmnx verson: 0.16.1

It's possible to use this function on a network without GTFS information?

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