-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·34 lines (26 loc) · 968 Bytes
/
Makefile
File metadata and controls
executable file
·34 lines (26 loc) · 968 Bytes
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
ENC_DIR := data/ENC_ROOT
TILES_DIR := tiles
ENC := $(wildcard $(ENC_DIR)/**/*.000)
TILES := $(patsubst $(ENC_DIR)/%.000,$(TILES_DIR)/%.pmtiles,$(ENC))
TILEJSON := $(patsubst $(ENC_DIR)/%.000,$(TILES_DIR)/%.json,$(ENC))
.PHONY: all clean data
all: $(TILES_DIR)/catalog.json ${TILES_DIR}/noaa.pmtiles
data:
@mkdir -p data
@echo "Downloading NOAA ENC data..."
curl -L -o data/ALL_ENCs.zip https://charts.noaa.gov/ENCs/All_ENCs.zip
@echo "Extracting ENC data..."
unzip -o data/ALL_ENCs.zip -d data
$(TILES_DIR)/%.pmtiles: $(ENC_DIR)/%.000
bin/s57-to-tiles $< $@
${TILES_DIR}/%.json: ${TILES_DIR}/%.pmtiles
pmtiles show --tilejson $< > $@
${TILES_DIR}/noaa.pmtiles: $(TILES)
# Increase file descriptor limit for tile-join
ulimit -n 100000; \
tile-join --force --no-tile-size-limit -o $@ $(TILES_DIR)/**/*.pmtiles
clean:
rm -rf $(TILES_DIR)
${TILES_DIR}/catalog.json: $(TILEJSON)
@rm -f $(TILES_DIR)/catalog.json
bin/catalog $(TILES_DIR)/**/*.json > $@