-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (42 loc) · 1.21 KB
/
Makefile
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
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -euo pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
include config.mk
NEW_NAMES := `echo $(MY_TABLE) | cut -d . -f 2`
# top level rule
build : import tiling
## import : Import and convert PG table to geojson line delimited
import : config.mk convert_to_geojson.sh
mkdir -p temp/
bash convert_to_geojson.sh $(MY_TABLE)
## tiling : Convert geojson to mbtiles
tiling : config.mk
tippecanoe --force -z$(MAX_Z) -Z$(MIN_Z) -o temp/$(MY_TABLE).mbtiles \
--read-parallel \
--full-detail=11 \
--minimum-detail=6 \
--low-detail=9 \
-l $(NEW_NAMES) \
temp/$(MY_TABLE).geojson
## point_tiles : convert point geojson to mbtiles
point_tiles : config.mk
tippecanoe --force -z$(MAX_Z) -Z$(MIN_Z) -o temp/$(MY_TABLE).mbtiles \
--read-parallel \
--gamma=3 \
--cluster-densest-as-needed \
temp/$(MY_TABLE).geojson
## pmtiling : Convert mbtiles to pmtiles
pmtiling: config.mk
pmtiles convert temp/$(MY_TABLE).mbtiles temp/$(MY_TABLE).pmtiles
## export_to_MB : Export to mapbox
export_to_MB :
Rscript R/send_to_mapbox.R $(MY_TABLE)
## clean : Delete temp/ directory
clean :
rm -rf temp/
.PHONY :clean
help : Makefile
@sed -n 's/^##//p' $<
.PHONY : help