From 910db7f60c839b0851838d9dc4e71a30eb5dc7f3 Mon Sep 17 00:00:00 2001 From: Falke Design Date: Wed, 1 Sep 2021 10:10:29 +0200 Subject: [PATCH] Remove area checks in Makefile for `import-borders` & `generate-tiles-pg` (#1200) While importing multiple .pbf files into postgres I was confronted with some unnecessary problems: 1. I wanted to use the borders of the planet which I had already generated. But `make import-borders` needs a .pbf file which is not necessary if the line.csv file is already existing -> So I added a check if the line.csv is **not** existing it checks for the `area parameter` / .pbf file 2. `make generate-tiles-pg` is only possible with a specified `area parameter` BUT the area is not used / needed for generation -> So I removed the area check --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 386eefc..638a372 100644 --- a/Makefile +++ b/Makefile @@ -402,8 +402,12 @@ import-data: start-db .PHONY: import-borders import-borders: start-db-nowait +ifeq (,$(wildcard $(BORDERS_CSV_FILE))) @$(assert_area_is_given) - # If CSV borders file already exists, use it without re-parsing + @echo "Generating borders out of $(PBF_FILE)" +else + @echo "Borders already exists. Useing $(BORDERS_CSV_FILE) to import borders" +endif $(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools sh -c \ 'pgwait && import-borders $$([ -f "$(BORDERS_CSV_FILE)" ] && echo load $(BORDERS_CSV_FILE) || echo import $(PBF_FILE))' @@ -414,7 +418,6 @@ import-sql: all start-db-nowait .PHONY: generate-tiles generate-tiles: all start-db - @$(assert_area_is_given) @echo "WARNING: This Mapnik-based method of tile generation is obsolete. Use generate-tiles-pg instead." @echo "Generating tiles into $(MBTILES_LOCAL_FILE) (will delete if already exists)..." @rm -rf "$(MBTILES_LOCAL_FILE)" @@ -425,7 +428,6 @@ generate-tiles: all start-db .PHONY: generate-tiles-pg generate-tiles-pg: all start-db - @$(assert_area_is_given) @echo "Generating tiles into $(MBTILES_LOCAL_FILE) (will delete if already exists) using PostGIS ST_MVT()..." @rm -rf "$(MBTILES_LOCAL_FILE)" $(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools generate-tiles