2020-12-15 23:49:25 +02:00
|
|
|
#uzupis
|
2020-12-16 08:00:45 +02:00
|
|
|
BOUNDS = xmin=582700 ymin=6060750 xmax=584830 ymax=6062750
|
|
|
|
XYZ = $(patsubst %.zip,%.xyz,$(wildcard 6*.zip))
|
2020-12-11 10:44:26 +02:00
|
|
|
SORT = sort -n -k2 -k1 -t,
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: smooth_2_5.gpkg smooth_5.gpkg
|
|
|
|
|
|
|
|
smooth_%.gpkg: db/smooth_%
|
|
|
|
ogr2ogr $@ "PG:host=127.0.0.1 user=osm dbname=osm" $(basename $@)
|
|
|
|
|
|
|
|
db/smooth_%: db/contour_% chaikin.sql
|
|
|
|
./managedb -- --echo-all \
|
|
|
|
-v ON_ERROR_STOP=1 \
|
|
|
|
-v src=$(notdir $(basename $<)) \
|
|
|
|
-v tbl=$(notdir $(basename $@)) \
|
|
|
|
-f chaikin.sql
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
db/contour_%: contour_%.gpkg db/.ready
|
|
|
|
./managedb -- -c "DROP TABLE IF EXISTS $(basename $<)"
|
|
|
|
ogr2ogr -f PostgreSQL "PG:host=127.0.0.1 user=osm dbname=osm" $<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
contour_%.gpkg: all.tif
|
|
|
|
gdal_contour -nln $(basename $@) -i $(subst _,.,$*) -a z $^ $@
|
|
|
|
|
2020-12-16 08:00:45 +02:00
|
|
|
all.tif: all.csv
|
2020-12-11 10:44:26 +02:00
|
|
|
gdal_translate $< $@ \
|
|
|
|
-ot Float32 -a_srs EPSG:3346 \
|
|
|
|
-co COMPRESS=DEFLATE -co PREDICTOR=2
|
|
|
|
|
2020-12-16 08:00:45 +02:00
|
|
|
.INTERMEDIATE: all.csv
|
|
|
|
all.csv: $(XYZ)
|
2020-12-11 10:44:26 +02:00
|
|
|
$(SORT) -m $^ > $@
|
|
|
|
|
|
|
|
.INTERMEDIATE: $(XYZ)
|
|
|
|
%.xyz: %.zip
|
|
|
|
unzip -qq -c $< $@ | \
|
2020-12-16 08:00:45 +02:00
|
|
|
./clip-2017.awk $(addprefix -v ,$(BOUNDS)) | \
|
2020-12-11 10:44:26 +02:00
|
|
|
$(SORT) > $@
|
|
|
|
|
|
|
|
db/.ready: managedb
|
2020-12-15 23:58:02 +02:00
|
|
|
mkdir -p db
|
2020-12-15 23:49:25 +02:00
|
|
|
./managedb start
|
2020-12-11 10:44:26 +02:00
|
|
|
touch $@
|