Created
July 5, 2019 15:07
-
-
Save farhanarrafi/1e359ce564e155913a9f10407b4f5531 to your computer and use it in GitHub Desktop.
Script to download map tiles from Open Street Maps for offline rendering
This file contains hidden or 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
#!/bin/sh | |
# Script to download map tiles from Open Street Maps | |
# Author: Farhan Ar Rafi | |
# number of tiles in x and y direction | |
# this will be 2^Z | |
N=7 | |
# sleep time between downloads | |
SLEEP=3 | |
# zoom level | |
Z=3 | |
for X in $(seq 0 $N); | |
do | |
for Y in $(seq 0 $N); | |
do | |
URL=http://a.tile.osm.org/$Z/$X/$Y.png; | |
FILE=$X$Y.png; | |
LOGS=download.log; | |
echo wget $URL -O $FILE -o $LOGS; | |
wget $URL -O $FILE -a $LOGS | |
sleep $SLEEP; | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment