-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the dev-data docs to an executable script
- Loading branch information
1 parent
d7072f6
commit 0197992
Showing
2 changed files
with
42 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# "normally" the app downloads the latest data from Overpass API based on the | ||
# user's clipped areas. | ||
# | ||
# For expediency and deterministic tests, this script downloads some | ||
# pre-configured areas, which the web app will load from localhost. | ||
|
||
cd "$(git rev-parse --show-toplevel)" | ||
|
||
download_to_subdir() { | ||
local subdir=$1 | ||
local url=$2 | ||
|
||
mkdir -p "$subdir" | ||
(wget -P "$subdir" --timestamping "$url" && echo "✅ $url") \ | ||
|| echo "❌ Download failed: $url" | ||
} | ||
|
||
cd web/public | ||
|
||
download_to_subdir osm https://assets.od2net.org/severance_pbfs/areas.json | ||
|
||
# Global data used for tests and demo data | ||
AREAS="bristol edinburgh strasbourg ut_dallas" | ||
for x in $AREAS; do | ||
download_to_subdir severance_pbfs "https://assets.od2net.org/severance_pbfs/$x.pbf" | ||
download_to_subdir boundaries "https://assets.od2net.org/boundaries/$x.geojson" | ||
done | ||
|
||
# Scotland specific data | ||
jq '.features[] | .properties.kind + "_" + .properties.name' ../../data_prep/scotland/boundaries.geojson | sed 's/"//g' | while read x; do | ||
download_to_subdir cnt_boundaries "https://assets.od2net.org/cnt_boundaries/$x.geojson" | ||
download_to_subdir cnt_osm "https://assets.od2net.org/cnt_osm/$x.osm.pbf" | ||
# OD Demand model | ||
download_to_subdir cnt_demand "https://assets.od2net.org/cnt_demand/demand_$x.bin" | ||
done | ||
|
||
for x in cbd.pmtiles gp_practices.geojson hospitals.geojson population.pmtiles route_network.pmtiles schools.geojson; do | ||
download_to_subdir cnt_layers https://assets.od2net.org/cnt_layers/$x | ||
done |