-
Notifications
You must be signed in to change notification settings - Fork 26
/
windows_download.ps1
20 lines (16 loc) · 1021 Bytes
/
windows_download.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$container_name = $args[0]
$country = $args[1]
$continent = $args[2]
$profile = $args[3]
docker pull osrm/osrm-backend;
if (!(Test-Path -Path \data\osrm\)){
mkdir \data\osrm\;
}
Set-Location \data\osrm\;
Invoke-WebRequest -URI https://download.geofabrik.de/$continent/$country-latest.osm.pbf -OutFile $country-latest.osm.pbf;
docker run -t --name osrm_extract -v ${PWD}:/data osrm/osrm-backend osrm-extract -p /opt/$profile.lua /data/$country-latest.osm.pbf;
docker run -t --name osrm_partition -v ${PWD}:/data osrm/osrm-backend osrm-partition /data/$country-latest.osm.pbf;
docker run -t --name osrm_customize -v ${PWD}:/data osrm/osrm-backend osrm-customize /data/$country-latest.osm.pbf;
docker container rm osrm_extract osrm_partition osrm_customize;
docker run -t --name "$($CONTAINER_NAME)_$($continent)_$($country)_$($profile)" -p 5000:5000 -v ${PWD}:/data osrm/osrm-backend osrm-routed --algorithm mld /data/$country-latest.osm.pbf;
# Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser