From 6f31e130a80caf21fecbdf316f57969354bdc080 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 23 Feb 2024 16:43:05 +0000 Subject: [PATCH] Try elevation data in the Edinburgh example. #18 --- examples/edinburgh/config.json | 5 +++-- examples/edinburgh/setup.py | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/edinburgh/config.json b/examples/edinburgh/config.json index 1fe1e1c..ca2ba6e 100644 --- a/examples/edinburgh/config.json +++ b/examples/edinburgh/config.json @@ -1,6 +1,6 @@ { "requests": { - "description": "Existing home to school cycling trips in Edinburgh, from NPT data. The origins and destinations are both building centroids, since not every zone has a school.", + "description": "Existing home to school cycling trips in Edinburgh, from NPT data. The origins and destinations are both building centroids, since not every zone has a school. Elevation is included.", "pattern": { "BetweenZones": { "zones_path": "zones.geojson", @@ -12,5 +12,6 @@ }, "cost": "Distance", "uptake": "GoDutchPCT", - "lts": "BikeOttawa" + "lts": "BikeOttawa", + "elevation_geotiff": "UK-dem-50m-4326.tif" } diff --git a/examples/edinburgh/setup.py b/examples/edinburgh/setup.py index 750f5c8..ee3a332 100644 --- a/examples/edinburgh/setup.py +++ b/examples/edinburgh/setup.py @@ -23,6 +23,14 @@ def makeOSM(): ) +def makeElevation(): + download( + url="https://play.abstreet.org/dev/data/input/shared/elevation/UK-dem-50m-4326.tif.gz", + outputFilename="input/UK-dem-50m-4326.tif.gz" + ) + run(["gunzip", "input/UK-dem-50m-4326.tif.gz"]) + + def makeOrigins(): # Not every zone has a school, so for now, just use all buildings for both # origins and destinations @@ -80,6 +88,7 @@ def makeOD(): checkDependencies() run(["mkdir", "-p", "input"]) makeOSM() + makeElevation() makeOrigins() makeDestinations() makeZones()