-
Notifications
You must be signed in to change notification settings - Fork 0
/
tanzaina_make
326 lines (245 loc) · 15.5 KB
/
tanzaina_make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# this make file contains dataset definitions for single country
geoextent = tza
#=================================================================================================
# Crash move folder -- the main target
#=================================================================================================
$(geoextent)_cmf: $(geoextent)_osm_datasets $(geoextent)_non_osm_datasets
status.py target "$@" "started" "$<"
zOsm2GeoJSON\completness_test.py "$(geoextent)" "data\out\mapaction\datasets\$(geoextent)"
if not exist "data\out\mapaction\cmf_zipped" md data\out\mapaction\cmf_zipped
tools\zip_cmf_json.bat data\out\mapaction\datasets\$(geoextent) data\out\mapaction\cmf_zipped\$@_json.zip
tools\zip_cmf_shp.bat data\out\mapaction\datasets\$(geoextent) data\out\mapaction\cmf_zipped\$@_shp.zip
zOsm2GeoJSON\writeCKANjson.py "data\out\mapaction\cmf_zipped\$@"
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\cmf_zipped\$@_json.zip s3://mekillot-backet/cmfs/$@_json.zip
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\cmf_zipped\$@_shp.zip s3://mekillot-backet/cmfs/$@_shp.zip
tools\update_ckan.bat data\out\mapaction\cmf_zipped\[email protected]
touch data\vtargets\$(@F)
status.py target "$@" "completed"
#=================================================================================================
# Symbolic target for OSM based datasets
#=================================================================================================
$(geoextent)_osm_datasets: \
$(geoextent)_tran_rds_ln_s4_osm_pp_mainroads \
$(geoextent)_tran_rds_ln_s4_osm_pp_roads \
$(geoextent)_tran_rrd_ln_s4_osm_pp_railways \
$(geoextent)_tran_rrd_ln_s4_osm_pp_subwaytram \
$(geoextent)_phys_dam_pt_s4_osm_pp_dam \
$(geoextent)_educ_edu_pt_s4_osm_pp_school \
$(geoextent)_educ_uni_pt_s4_osm_pp_university\
$(geoextent)_tran_fte_pt_s4_osm_pp_ferry_terminal \
$(geoextent)_tran_fer_ln_s4_osm_pp_ferry_route \
$(geoextent)_tran_por_pt_s4_osm_pp_port \
$(geoextent)_cash_bnk_pt_s4_osm_pp_banks \
$(geoextent)_cash_atm_pt_s4_osm_pp_atm \
$(geoextent)_heal_hea_pt_s4_osm_pp_health_facilities \
$(geoextent)_heal_hos_pt_s4_osm_pp_hospitals \
$(geoextent)_cash_mkt_pt_s4_osm_pp_marketplace \
$(geoextent)_pois_rel_pt_s4_osm_pp_place_of_worship \
$(geoextent)_cccm_ref_pt_s4_osm_pp_refugee_site \
$(geoextent)_pois_bor_pt_s4_osm_pp_border_control \
$(geoextent)_stle_stl_pt_s4_osm_pp_settlements \
$(geoextent)_stle_stl_pt_s4_osm_pp_townscities \
$(geoextent)_tran_brg_pt_s4_osm_pp_bridges \
$(geoextent)_util_ppl_ln_s4_osm_pp_pipeline \
$(geoextent)_util_pwl_ln_s4_osm_pp_powerline \
$(geoextent)_util_pst_pt_s4_osm_pp_powerstation \
$(geoextent)_util_pst_pt_s4_osm_pp_substation \
$(geoextent)_util_mil_py_s4_osm_pp_militaryinstallation \
$(geoextent)_phys_lak_py_s4_osm_pp_natural_water \
$(geoextent)_phys_riv_ln_s4_osm_pp_rivers \
$(geoextent)_tran_can_ln_s4_osm_pp_canals \
$(geoextent)_tran_rst_pt_s4_osm_pp_railway_station \
$(geoextent)_shel_eaa_pt_s4_osm_pp_emergency \
$(geoextent)_wash_wts_pt_s4_osm_pp_water_source \
$(geoextent)_wash_toi_pt_s4_osm_pp_toilets\
$(geoextent)_elev_cst_ln_s4_osm_pp_coastline \
$(geoextent)_tran_air_pt_s4_osm_pp_airports \
$(geoextent)_admn_ad0_py_s4_osm_pp_adminboundary0 \
$(geoextent)_admn_ad1_py_s4_osm_pp_adminboundary1 \
$(geoextent)_admn_ad2_py_s4_osm_pp_adminboundary2 \
$(geoextent)_admn_ad3_py_s4_osm_pp_adminboundary3 \
# $(geoextent)_bldg_bdg_py_s4_osm_pp_buildings
echo OSM layers completed OK
touch data\vtargets\$(@F)
#=================================================================================================
# Symbolic target for Non-osm datasets
#=================================================================================================
$(geoextent)_non_osm_datasets: $(geoextent)_tran_rds_ln_s0_naturalearth_pp_roads \
$(geoextent)_stle_stl_pt_s0_naturalearth_pp_maincities \
$(geoextent)_phys_riv_ln_s0_naturalearth_pp_rivers \
$(geoextent)_phys_lak_py_s0_naturalearth_pp_waterbodies \
$(geoextent)_elev_cst_ln_s0_naturalearth_pp_coastline \
$(geoextent)_tran_air_pt_s0_ourairports_pp_airports \
$(geoextent)_tran_rrd_ln_s0_wfp_pp_railways \
$(geoextent)_util_pst_pt_s0_gppd_pp_powerplants \
$(geoextent)_tran_por_pt_s0_worldports_pp_ports
echo Non-osm layers completed OK
touch data\vtargets\$(@F)
#=================================================================================================
# OSM based datasets
#=================================================================================================
#roads
$(geoextent)_tran_rds_ln_s4_osm_pp_roads: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran,--keep= --keep-ways="highway=motorway =trunk =primary =secondary =tertiary =unclassified =residential =motorway_link =trunk_link =primary_link =secondary_link =tertiary_link =lining_street =service =track =road",write_lines)
#main roads
$(geoextent)_tran_rds_ln_s4_osm_pp_mainroads: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran,--keep= --keep-ways="highway=motorway =trunk =primary =secondary =tertiary =motorway_link =trunk_link =primary_link =secondary_link =tertiary_link",write_lines)
#railroads
$(geoextent)_tran_rrd_ln_s4_osm_pp_railways: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep= --keep-ways="railway=rail",write_lines)
#urban rail
$(geoextent)_tran_rrd_ln_s4_osm_pp_subwaytram: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep= --keep-ways="railway=subway =tram",write_lines)
#dam
$(geoextent)_phys_dam_pt_s4_osm_pp_dam: $(geoextent).o5m
$(call generate_dataset_from_osm,221_phys, --keep="waterway=dam",write_poi)
#education_school
$(geoextent)_educ_edu_pt_s4_osm_pp_school: $(geoextent).o5m
$(call generate_dataset_from_osm,210_educ,--keep="amenity=school",write_poi)
#education_high
$(geoextent)_educ_uni_pt_s4_osm_pp_university: $(geoextent).o5m
$(call generate_dataset_from_osm,210_educ,--keep="amenity=college =university",write_poi)
#ferry terminal
$(geoextent)_tran_fte_pt_s4_osm_pp_ferry_terminal: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="amenity=ferry_terminal",write_poi)
#ferry route
$(geoextent)_tran_fer_ln_s4_osm_pp_ferry_route: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="route=ferry",write_lines)
#port
$(geoextent)_tran_por_pt_s4_osm_pp_port: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="( landuse=harbour =port ) or ( industrial=port ) ",write_poi)
#banks
$(geoextent)_cash_bnk_pt_s4_osm_pp_banks: $(geoextent).o5m
$(call generate_dataset_from_osm,208_cash, --keep="amenity=bank",write_poi)
#atm
$(geoextent)_cash_atm_pt_s4_osm_pp_atm: $(geoextent).o5m
$(call generate_dataset_from_osm,208_cash, --keep="amenity=atm or ( amenity=bank and atm=yes )",write_poi)
#health_facilities
$(geoextent)_heal_hea_pt_s4_osm_pp_health_facilities: $(geoextent).o5m
$(call generate_dataset_from_osm,215_heal, --keep="amenity=clinic =doctors =health_post =pharmacy =hospital",write_poi)
#hospitals
$(geoextent)_heal_hos_pt_s4_osm_pp_hospitals: $(geoextent).o5m
$(call generate_dataset_from_osm,215_heal, --keep="amenity=hospital",write_poi)
#market_place
$(geoextent)_cash_mkt_pt_s4_osm_pp_marketplace: $(geoextent).o5m
$(call generate_dataset_from_osm,208_cash, --keep="amenity=marketplace",write_poi)
#place_of_worship
$(geoextent)_pois_rel_pt_s4_osm_pp_place_of_worship: $(geoextent).o5m
$(call generate_dataset_from_osm,222_pois, --keep="amenity=place_of_worship",write_poi)
#refugee_site
$(geoextent)_cccm_ref_pt_s4_osm_pp_refugee_site: $(geoextent).o5m
$(call generate_dataset_from_osm,209_cccm, --keep="amenity=refugee_site",write_poi)
#border_control
$(geoextent)_pois_bor_pt_s4_osm_pp_border_control: $(geoextent).o5m
$(call generate_dataset_from_osm,222_pois, --keep="barrier=border_control",write_poi)
#Settlements
$(geoextent)_stle_stl_pt_s4_osm_pp_settlements: $(geoextent).o5m
$(call generate_dataset_from_osm,229_stle, --keep="place=city =borough =town =village =hamlet",write_poi)
#townscities
$(geoextent)_stle_stl_pt_s4_osm_pp_townscities: $(geoextent).o5m
$(call generate_dataset_from_osm,229_stle, --keep="place=city =town",write_poi)
#Buildings!
$(geoextent)_bldg_bdg_py_s4_osm_pp_buildings: $(geoextent).o5m
$(call generate_dataset_from_osm,206_bldg, --keep="building= ",write_poly)
#bridges
$(geoextent)_tran_brg_pt_s4_osm_pp_bridges: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="man_made=bridge",write_poi)
#pipeline
$(geoextent)_util_ppl_ln_s4_osm_pp_pipeline: $(geoextent).o5m
$(call generate_dataset_from_osm,233_util, --keep="man_made=pipeline",write_lines)
#powerline
$(geoextent)_util_pwl_ln_s4_osm_pp_powerline: $(geoextent).o5m
$(call generate_dataset_from_osm,233_util, --keep="power=line",write_lines)
#powerstation
$(geoextent)_util_pst_pt_s4_osm_pp_powerstation: $(geoextent).o5m
$(call generate_dataset_from_osm,233_util, --keep="power=plant",write_poi)
#substation
$(geoextent)_util_pst_pt_s4_osm_pp_substation: $(geoextent).o5m
$(call generate_dataset_from_osm,233_util, --keep="power=substation",write_poi)
#military areas
$(geoextent)_util_mil_py_s4_osm_pp_militaryinstallation: $(geoextent).o5m
$(call generate_dataset_from_osm,233_util, --keep="landuse=military or military= ",write_poly)
#water bodies
$(geoextent)_phys_lak_py_s4_osm_pp_natural_water: $(geoextent).o5m
$(call generate_dataset_from_osm,221_phys, --keep="natural=water",write_poly)
#rivers as lines
$(geoextent)_phys_riv_ln_s4_osm_pp_rivers: $(geoextent).o5m
$(call generate_dataset_from_osm,221_phys, --keep="waterway=river",write_lines)
#canals, for some reason in tran group
$(geoextent)_tran_can_ln_s4_osm_pp_canals: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="waterway=canal",write_lines)
#railway stations
$(geoextent)_tran_rst_pt_s4_osm_pp_railway_station: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="railway=station =halt ",write_poi)
#emergency
$(geoextent)_shel_eaa_pt_s4_osm_pp_emergency: $(geoextent).o5m
$(call generate_dataset_from_osm,228_shel, --keep="emergency=assembly_point",write_poi)
#water source
$(geoextent)_wash_wts_pt_s4_osm_pp_water_source: $(geoextent).o5m
$(call generate_dataset_from_osm,234_wash, --keep="amenity=drinking_water or drinking_water=yes ",write_poi)
#toilets
$(geoextent)_wash_toi_pt_s4_osm_pp_toilets: $(geoextent).o5m
$(call generate_dataset_from_osm,234_wash, --keep="amenity=toilets",write_poi)
#coast lines
$(geoextent)_elev_cst_ln_s4_osm_pp_coastline: $(geoextent).o5m
$(call generate_dataset_from_osm,211_elev, --keep="natural=coastline",write_lines)
#airports
$(geoextent)_tran_air_pt_s4_osm_pp_airports: $(geoextent).o5m
$(call generate_dataset_from_osm,232_tran, --keep="aeroway=aerodrome",write_poi)
#admin boundaries
# should be both lines and polygons
$(geoextent)_admn_ad0_py_s4_osm_pp_adminboundary0: $(geoextent).o5m
$(call generate_dataset_from_osm,202_admn, --keep= --keep-relations="( boundary=administrative ) and ( admin_level=2 )",write_poly)
$(geoextent)_admn_ad1_py_s4_osm_pp_adminboundary1: $(geoextent).o5m
$(call generate_dataset_from_osm,202_admn, --keep= --keep-relations="boundary=administrative and admin_level=4",write_poly)
$(geoextent)_admn_ad2_py_s4_osm_pp_adminboundary2: $(geoextent).o5m
$(call generate_dataset_from_osm,202_admn, --keep= --keep-relations="boundary=administrative and admin_level=5",write_poly)
$(geoextent)_admn_ad3_py_s4_osm_pp_adminboundary3: $(geoextent).o5m
$(call generate_dataset_from_osm,202_admn, --keep= --keep-relations="( boundary=administrative ) and ( admin_level=6 or admin_level=7 or admin_level=8 or admin_level=9 or admin_level=10 )",write_poly)
#=================================================================================================
# Extraction of geoextent
#=================================================================================================
$(geoextent).o5m: planet-latest.osm.pbf | data\in\mapaction\per_country_pbf
osmium extract -s smart -p static_data\mapaction_poly_files\$(geoextent).poly data\in\planet.osm\planet-latest.osm.pbf -o data\in\mapaction\per_country_pbf\$(geoextent).pbf --overwrite
osmconvert data\in\mapaction\per_country_pbf\$(geoextent).pbf -o=data\in\mapaction\per_country_pbf\$(geoextent).o5m
#=================================================================================================
# Non-osm datasets, from global data
#=================================================================================================
#-------------------------------------------------------------------------------------------------
# Natural Earth
#-------------------------------------------------------------------------------------------------
#from ESRI SHAPE FILE
$(geoextent)_tran_rds_ln_s0_naturalearth_pp_roads: data\in\mapaction\natural_earth\ne_10m_roads
$(call generate_dataset_from_shp,232_tran)
$(geoextent)_stle_stl_pt_s0_naturalearth_pp_maincities: data\in\mapaction\natural_earth\ne_10m_populated_places
$(call generate_dataset_from_shp,229_stle)
$(geoextent)_phys_riv_ln_s0_naturalearth_pp_rivers: data\in\mapaction\natural_earth\ne_10m_rivers_lake_centerlines
$(call generate_dataset_from_shp,221_phys)
$(geoextent)_phys_lak_py_s0_naturalearth_pp_waterbodies: data\in\mapaction\natural_earth\ne_10m_lakes
$(call generate_dataset_from_shp,221_phys)
$(geoextent)_elev_cst_ln_s0_naturalearth_pp_coastline: data\in\mapaction\natural_earth\ne_10m_coastline
$(call generate_dataset_from_shp,211_elev)
#-------------------------------------------------------------------------------------------------
# Our Airports
#-------------------------------------------------------------------------------------------------
#from CSV file
$(geoextent)_tran_air_pt_s0_ourairports_pp_airports: data\in\mapaction/ourairports/airports.csv
$(call generate_dataset_from_csv,232_tran)
#-------------------------------------------------------------------------------------------------
# World Ports
#-------------------------------------------------------------------------------------------------
#from CSV file
$(geoextent)_tran_por_pt_s0_worldports_pp_ports: data\in\mapaction/worldports/UpdatedPub150.csv
$(call generate_dataset_from_csv,232_tran)
#-------------------------------------------------------------------------------------------------
# WFP Railroads
#-------------------------------------------------------------------------------------------------
#from ESRI SHAPE FILE
$(geoextent)_tran_rrd_ln_s0_wfp_pp_railways: data\in\mapaction/WFP/wld_trs_railways_wfp
$(call generate_dataset_from_shp,232_tran)
#-------------------------------------------------------------------------------------------------
# Global Power Plant Database
#-------------------------------------------------------------------------------------------------
#from CSV file
$(geoextent)_util_pst_pt_s0_gppd_pp_powerplants: data\in\mapaction\gppd\global_power_plant_database.csv
$(call generate_dataset_from_csv,233_util)