-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (27 loc) · 1.24 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
SRC_DIR = src
DST_DIR = dst
MINZOOM = 9
MAXZOOM = 12
LAYER = terrain22
#N = 44 # Give as environment variable
SHP_PATH = $(SRC_DIR)/Poly_$(N)/Poly_$(N).shp
DBF_PATH = $(SRC_DIR)/Poly_$(N)/GlobalCluster_$(N).dbf
default:
ogr2ogr -sql "SELECT a.*, b.* FROM Poly_$(N) a \
LEFT JOIN '$(DBF_PATH)'.GlobalCluster_$(N) b ON a.polyID = b.POLYID" \
-of GeoJSONSeq -lco COORDINATE_PRECISION=12 /vsistdout/ $(SHP_PATH) | \
ruby filter.rb | \
tippecanoe --layer $(LAYER) --minimum-zoom $(MINZOOM) --maximum-zoom $(MAXZOOM) \
-f -o $(DST_DIR)/$(N).pmtiles
geojsons:
ogr2ogr -sql "SELECT a.*, b.* FROM Poly_$(N) a \
LEFT JOIN '$(DBF_PATH)'.GlobalCluster_$(N) b ON a.polyID = b.POLYID" \
-of GeoJSONSeq -lco COORDINATE_PRECISION=12 /vsistdout/ $(SHP_PATH) | \
ruby filter.rb | bzip2 -9c > $(SRC_DIR)/$(N).geojsons.bz2
pmtiles:
ls $(SRC_DIR)/*.bz2 | xargs -n 1 sh -c 'bzcat "$$0" || true' | tippecanoe-json-tool |\
tippecanoe --layer $(LAYER) --minimum-zoom $(MINZOOM) \
--maximum-zoom $(MAXZOOM) -f -o $(DST_DIR)/terrain22.pmtiles
# ls $(SRC_DIR)/*.bz2 | egrep -v "src/(29|72|74)\.geojsons.bz2" | xargs -n 1 sh -c 'bzcat "$$0" || true' | tippecanoe-json-tool |\
upload:
aws s3 cp $(DST_DIR)/terrain22.pmtiles s3://us-west-2.opendata.source.coop/smartmaps/foil4gr1/