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

Graph loads synthetic routes #25

merged 23 commits into from Mar 3, 2018


None yet
2 participants
Copy link

kuanb commented Mar 3, 2018

MVP feature response to #24

Given a GeoJSON with minimal attributes, generates additional nodes and edges that can be loaded/added to a network graph. This allows for simple, ad hoc additions to existing transit systems.

Draw a simple shape of a proposed bus route:

Add 3 properties:

  • headway (in seconds)
  • avg_speed (in kmph)
  • stop_dist (in meters)

And add it to your existing conditions network!

G = load_synthetic_network_as_graph(reference_geojson, existing_graph=G)

GIF showing a load in action:

The entire workflow is dead simple:

import peartree as pt

# Load in your existing conditions
path = 'data/'
feed = pt.get_representative_feed(path)

# Convert it to a network graph with Peartree
start = 7*60*60  # 7:00 AM
end = 10*60*60  # 10:00 AM
G = pt.load_feed_as_graph(feed, start, end)

# Then load in your new GeoJSON of a proposed route
geojson_path = 'data/synthetic_example.geojson'
with open(geojson_path, 'r') as gjf:
    reference_geojson = json.load(gjf)
G = load_synthetic_network_as_graph(reference_geojson, existing_graph=G)

@kuanb kuanb changed the title Graph loads synthetic routes (WIP) (WIP) Graph loads synthetic routes Mar 3, 2018


This comment has been minimized.

Copy link

coveralls commented Mar 3, 2018

Coverage Status

Coverage increased (+2.2%) to 89.036% when pulling 9f77662 on kuanb-synthetic-routes into 3363f63 on master.

kuanb added some commits Mar 3, 2018

@kuanb kuanb changed the title (WIP) Graph loads synthetic routes Graph loads synthetic routes Mar 3, 2018

@kuanb kuanb merged commit 7dd6ff0 into master Mar 3, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
coverage/coveralls Coverage increased (+0.2%) to 89.036%

@kuanb kuanb deleted the kuanb-synthetic-routes branch Mar 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment