From 3d6437f37c24717e47a76e10deb095b8157017a4 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Mon, 26 Feb 2024 13:22:10 +0000 Subject: [PATCH] Use real OD data for Lisbon. #56 --- examples/lisbon/config.json | 9 +++++++-- examples/lisbon/setup.py | 22 +++++++++++++++++----- examples/utils.py | 1 + 3 files changed, 25 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() diff --git a/examples/utils.py b/examples/utils.py index cba29a0..eb99faa 100644 --- a/examples/utils.py +++ b/examples/utils.py @@ -23,6 +23,7 @@ def download(url, outputFilename): run( [ "curl", + "-L", url, "-o", outputFilename,