ITSLeeds / routingday

Mini hackathon on reproducible route network generation
Creative Commons Zero v1.0 Universal
2 stars 1 forks source link

Aequillibrea benchmark #4

Open Robinlovelace opened 1 month ago

Robinlovelace commented 1 month ago

Based on this, will try to apply it to Leeds: https://aequilibrae.com/python/latest/_auto_examples/assignment_workflows/plot_route_choice_set.html#sphx-glr-auto-examples-assignment-workflows-plot-route-choice-set-py

Robinlovelace commented 1 month ago

Python code to work from: https://github.com/AequilibraE/aequilibrae/blob/develop/docs/source/examples/assignment_workflows/plot_route_choice.py

pedrocamargo commented 1 month ago

Hey Robin, This is a nice hackaton you are going to have here. Let me just make a few comments:

Robinlovelace commented 1 month ago

Great stuff, will give it a spin, many thanks jumping on this Pedro!

Robinlovelace commented 1 month ago

OK, starting slow, have got the example code running in Quarto, looking good!

image

Source: https://github.com/ITSLeeds/routingday/pull/5

Robinlovelace commented 1 month ago

@pedrocamargo sorry to bother but looking at https://aequilibrae.com/python/latest/_auto_examples/aequilibrae_without_a_model/plot_assignment_without_model.html I'm not sure how to import the OSM network. See code and commit below for where we've got to (not far):

# Create a project for Leeds
from aequilibrae.project import Project
p = Project()
#| eval: false
p.new('leeds_project')
p.open('leeds_project')
import geopandas as gpd
zones = gpd.read_file('input_data/zones_msoa_leeds.geojson')
# p.network.create_from_osm(model_area = zones, modes = ['car'])
# Fails with 
p.network.create_from_osm(place_name = 'Leeds, UK')
AttributeError                            Traceback (most recent call last)
Cell In[17], [line 1](vscode-notebook-cell:?execution_count=17&line=1)
----> [1](vscode-notebook-cell:?execution_count=17&line=1) p.open('leeds_project')
      [2](vscode-notebook-cell:?execution_count=17&line=2) import geopandas as gpd
      [3](vscode-notebook-cell:?execution_count=17&line=3) zones = gpd.read_file('input_data/zones_msoa_leeds.geojson')
pedrocamargo commented 1 month ago

@Robinlovelace , you don;t need to open the project after creating it. It is already open:

https://aequilibrae.com/python/latest/_auto_examples/creating_models/from_osm.html#sphx-glr-auto-examples-creating-models-from-osm-py