From a6555f3690a5c868b4a55daea89356e52dbd0beb Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Mon, 26 Feb 2024 13:19:50 +0000 Subject: [PATCH] Use real OD data for Lisbon. #56 --- examples/lisbon/config.json | 9 +++++++-- examples/lisbon/setup.py | 22 +++++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/examples/lisbon/config.json b/examples/lisbon/config.json index ea25034..766c87a 100644 --- a/examples/lisbon/config.json +++ b/examples/lisbon/config.json @@ -1,9 +1,14 @@ { "requests": { "description": "One trip from every building to the nearest (as the crow flies) school. Elevation is included.", - "pattern": "FromEveryOriginToNearestDestination", + "pattern": { + "BetweenZones": { + "zones_path": "zones.geojson", + "csv_path": "od.csv" + } + }, "origins_path": "buildings.geojson", - "destinations_path": "schools.geojson" + "destinations_path": "buildings.geojson" }, "cost": { "OsmHighwayType": { diff --git a/examples/lisbon/setup.py b/examples/lisbon/setup.py index 5c276d7..8121320 100644 --- a/examples/lisbon/setup.py +++ b/examples/lisbon/setup.py @@ -38,11 +38,21 @@ def makeOrigins(): def makeDestinations(): - # School centroids as destinations - extractCentroids( - osmInput="input/input.osm.pbf", - geojsonOutput="input/schools.geojson", - where=f"amenity = 'school'", + # Same as origins + pass + + +def makeZones(): + download( + url="https://github.com/U-Shift/biclar/releases/download/0.0.1/zones.geojson", + outputFilename="input/zones.geojson", + ) + + +def makeOD(): + download( + url="https://github.com/U-Shift/biclar/releases/download/0.0.1/od.csv", + outputFilename="input/od.csv", ) @@ -53,3 +63,5 @@ def makeDestinations(): makeElevation() makeOrigins() makeDestinations() + makeZones() + makeOD()