-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions_make
54 lines (52 loc) · 4.28 KB
/
functions_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
#=================================================================================================
# Definitions of operations
#=================================================================================================
# Generate dataset (json+shp) from OSM file
define generate_dataset_from_osm
status.py target "$@" "started" "$<"
if not exist "data\out\mapaction\datasets\$(geoextent)\$(1)" md data\out\mapaction\datasets\$(geoextent)\$(1)
if not exist "data\mid\interim_osm" md "data\mid\interim_osm"
if not exist "data\out\mapaction\zipped" md "data\out\mapaction\zipped"
if not exist "data\vtargets" md "data\vtargets"
tools\osmfilter.exe data\in\mapaction\per_country_pbf\$(geoextent).o5m $(2) -o=data\mid\interim_osm\[email protected]
zOsm2GeoJSON\zOsm2GeoJSON.py data\mid\interim_osm\[email protected] data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] --action=$(3) $(2)
ogr2ogr.exe -lco ENCODING=UTF8 -skipfailures data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]
tools\zip_json.bat data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] data\out\mapaction\zipped\[email protected]
tools\zip_shp.bat data\out\mapaction\datasets\$(geoextent)\$(1)\$@ data\out\mapaction\zipped\[email protected]
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\zipped\[email protected] s3://mekillot-backet/datasets/[email protected]
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\zipped\[email protected] s3://mekillot-backet/datasets/[email protected]
tools\update_ckan.bat data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]
status.py target "$@" "completed"
touch data\vtargets\$(@F)
echo $@ completed
endef
# Generate dataset (json+shp) from SHP file, + clipping
define generate_dataset_from_shp
status.py target "$@" "started" "$<"
if not exist "data\out\mapaction\datasets\$(geoextent)\$(1)" md data\out\mapaction\datasets\$(geoextent)\$(1)
ogr2ogr.exe -clipsrc static_data\mapaction_poly_files\$(geoextent).json -lco ENCODING=UTF8 -skipfailures data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] $<\$(<F).shp
ogr2ogr.exe -skipfailures data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]
tools\zip_json.bat data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] data\out\mapaction\zipped\[email protected]
tools\zip_shp.bat data\out\mapaction\datasets\$(geoextent)\$(1)\$@ data\out\mapaction\zipped\[email protected]
zOsm2GeoJSON\writeCKANjson.py "data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]"
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\zipped\[email protected] s3://mekillot-backet/datasets/[email protected]
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\zipped\[email protected] s3://mekillot-backet/datasets/[email protected]
tools\update_ckan.bat data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]
status.py target "$@" "completed"
touch data\vtargets\$(@F)
endef
# Generate dataset (json+shp) from CSV file, + clipping
define generate_dataset_from_csv
status.py target "$@" "started" "$<"
if not exist "data\out\mapaction\datasets\$(geoextent)\$(1)" md data\out\mapaction\datasets\$(geoextent)\$(1)
ogr2ogr.exe -s_srs EPSG:4326 -t_srs EPSG:3857 -oo X_POSSIBLE_NAMES=lon* -oo Y_POSSIBLE_NAMES=lat* -lco ENCODING=UTF8 -clipsrc static_data\mapaction_poly_files\$(geoextent).json -f "ESRI Shapefile" data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] $<
ogr2ogr.exe -skipfailures data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]
zOsm2GeoJSON\writeCKANjson.py "data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]"
tools\zip_json.bat data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected] data\out\mapaction\zipped\[email protected]
tools\zip_shp.bat data\out\mapaction\datasets\$(geoextent)\$(1)\$@ data\out\mapaction\zipped\[email protected]
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\zipped\[email protected] s3://mekillot-backet/datasets/[email protected]
aws --endpoint-url=https://storage.yandexcloud.net s3 cp data\out\mapaction\zipped\[email protected] s3://mekillot-backet/datasets/[email protected]
tools\update_ckan.bat data\out\mapaction\datasets\$(geoextent)\$(1)\[email protected]
status.py target "$@" "completed"
touch data\vtargets\$(@F)
endef