Skip to content

Commit dcf815f

Browse files
committed
feat: download fixed files list instead of scraping
1 parent c99d698 commit dcf815f

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed

osm/dl_pbf.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# read the pbf list and download each file
3+
pbf_list="pbf_list.txt"
4+
if [[ ! -f "$pbf_list" ]]; then
5+
echo "$(date +'%Y-%m-%d %H:%M:%S') - pbf list not found!" >> download.log
6+
exit 1
7+
fi
8+
while IFS= read -r file; do
9+
if [[ -z "$file" || "$file" =~ ^# ]]; then
10+
continue
11+
fi
12+
mkdir -p "$(dirname "$file")"
13+
echo "$(date +'%Y-%m-%d %H:%M:%S') - Downloading https://download.geofabrik.de/$file" >> download.log
14+
wget -q "https://download.geofabrik.de/$file" -O "$file"
15+
if [[ $? -ne 0 ]]; then
16+
echo "$(date +'%Y-%m-%d %H:%M:%S') - Failed to download $file" >> download.log
17+
else
18+
# output timestamp
19+
echo "$(date +'%Y-%m-%d %H:%M:%S') - Downloaded $file" >> download.log
20+
fi
21+
done < "$pbf_list"
22+
echo "$(date +'%Y-%m-%d %H:%M:%S') - All downloads completed." >> download.log

osm/pbf_list.txt

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
africa-latest.osm.pbf
2+
antarctica-latest.osm.pbf
3+
asia/afghanistan-latest.osm.pbf
4+
asia/armenia-latest.osm.pbf
5+
asia/azerbaijan-latest.osm.pbf
6+
asia/bangladesh-latest.osm.pbf
7+
asia/bhutan-latest.osm.pbf
8+
asia/cambodia-latest.osm.pbf
9+
asia/china-latest.osm.pbf
10+
asia/east-timor-latest.osm.pbf
11+
asia/gcc-states-latest.osm.pbf
12+
asia/india-latest.osm.pbf
13+
asia/indonesia-latest.osm.pbf
14+
asia/iran-latest.osm.pbf
15+
asia/iraq-latest.osm.pbf
16+
asia/israel-and-palestine-latest.osm.pbf
17+
asia/japan-latest.osm.pbf
18+
asia/jordan-latest.osm.pbf
19+
asia/kazakhstan-latest.osm.pbf
20+
asia/kyrgyzstan-latest.osm.pbf
21+
asia/laos-latest.osm.pbf
22+
asia/lebanon-latest.osm.pbf
23+
asia/malaysia-singapore-brunei-latest.osm.pbf
24+
asia/maldives-latest.osm.pbf
25+
asia/mongolia-latest.osm.pbf
26+
asia/myanmar-latest.osm.pbf
27+
asia/nepal-latest.osm.pbf
28+
asia/north-korea-latest.osm.pbf
29+
asia/pakistan-latest.osm.pbf
30+
asia/philippines-latest.osm.pbf
31+
asia/south-korea-latest.osm.pbf
32+
asia/sri-lanka-latest.osm.pbf
33+
asia/syria-latest.osm.pbf
34+
asia/taiwan-latest.osm.pbf
35+
asia/tajikistan-latest.osm.pbf
36+
asia/thailand-latest.osm.pbf
37+
asia/turkmenistan-latest.osm.pbf
38+
asia/uzbekistan-latest.osm.pbf
39+
asia/vietnam-latest.osm.pbf
40+
asia/yemen-latest.osm.pbf
41+
australia-oceania-latest.osm.pbf
42+
central-america-latest.osm.pbf
43+
europe/albania-latest.osm.pbf
44+
europe/andorra-latest.osm.pbf
45+
europe/austria-latest.osm.pbf
46+
europe/azores-latest.osm.pbf
47+
europe/belarus-latest.osm.pbf
48+
europe/belgium-latest.osm.pbf
49+
europe/bosnia-herzegovina-latest.osm.pbf
50+
europe/bulgaria-latest.osm.pbf
51+
europe/croatia-latest.osm.pbf
52+
europe/cyprus-latest.osm.pbf
53+
europe/czech-republic-latest.osm.pbf
54+
europe/denmark-latest.osm.pbf
55+
europe/estonia-latest.osm.pbf
56+
europe/faroe-islands-latest.osm.pbf
57+
europe/finland-latest.osm.pbf
58+
europe/france-latest.osm.pbf
59+
europe/georgia-latest.osm.pbf
60+
europe/germany-latest.osm.pbf
61+
europe/great-britain-latest.osm.pbf
62+
europe/greece-latest.osm.pbf
63+
europe/guernsey-jersey-latest.osm.pbf
64+
europe/hungary-latest.osm.pbf
65+
europe/iceland-latest.osm.pbf
66+
europe/ireland-and-northern-ireland-latest.osm.pbf
67+
europe/isle-of-man-latest.osm.pbf
68+
europe/italy-latest.osm.pbf
69+
europe/kosovo-latest.osm.pbf
70+
europe/latvia-latest.osm.pbf
71+
europe/liechtenstein-latest.osm.pbf
72+
europe/lithuania-latest.osm.pbf
73+
europe/luxembourg-latest.osm.pbf
74+
europe/macedonia-latest.osm.pbf
75+
europe/malta-latest.osm.pbf
76+
europe/moldova-latest.osm.pbf
77+
europe/monaco-latest.osm.pbf
78+
europe/montenegro-latest.osm.pbf
79+
europe/netherlands-latest.osm.pbf
80+
europe/norway-latest.osm.pbf
81+
europe/poland-latest.osm.pbf
82+
europe/portugal-latest.osm.pbf
83+
europe/romania-latest.osm.pbf
84+
europe/serbia-latest.osm.pbf
85+
europe/slovakia-latest.osm.pbf
86+
europe/slovenia-latest.osm.pbf
87+
europe/spain-latest.osm.pbf
88+
europe/sweden-latest.osm.pbf
89+
europe/switzerland-latest.osm.pbf
90+
europe/turkey-latest.osm.pbf
91+
europe/ukraine-latest.osm.pbf
92+
europe/united-kingdom-latest.osm.pbf
93+
north-america/canada/alberta-latest.osm.pbf
94+
north-america/canada/british-columbia-latest.osm.pbf
95+
north-america/canada/manitoba-latest.osm.pbf
96+
north-america/canada/new-brunswick-latest.osm.pbf
97+
north-america/canada/newfoundland-and-labrador-latest.osm.pbf
98+
north-america/canada/northwest-territories-latest.osm.pbf
99+
north-america/canada/nova-scotia-latest.osm.pbf
100+
north-america/canada/nunavut-latest.osm.pbf
101+
north-america/canada/ontario-latest.osm.pbf
102+
north-america/canada/prince-edward-island-latest.osm.pbf
103+
north-america/canada/quebec-latest.osm.pbf
104+
north-america/canada/saskatchewan-latest.osm.pbf
105+
north-america/canada/yukon-latest.osm.pbf
106+
north-america/greenland-latest.osm.pbf
107+
north-america/mexico-latest.osm.pbf
108+
north-america/us-midwest-latest.osm.pbf
109+
north-america/us-northeast-latest.osm.pbf
110+
north-america/us-pacific-latest.osm.pbf
111+
north-america/us-south-latest.osm.pbf
112+
north-america/us-west-latest.osm.pbf
113+
russia-latest.osm.pbf
114+
south-america-latest.osm.pbf
115+
# keep last line empty

0 commit comments

Comments
 (0)