From cbe6b70c0062e712ab61b7a42a17d0a2b0022afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 16 Dec 2020 08:00:45 +0200 Subject: [PATCH] grids --- contours/Makefile.2008 | 7 +++++-- contours/Makefile.2017 | 14 ++++++-------- contours/all.vrt | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/contours/Makefile.2008 b/contours/Makefile.2008 index 8828eae..5658827 100644 --- a/contours/Makefile.2008 +++ b/contours/Makefile.2008 @@ -1,7 +1,10 @@ #uzupis #BOUNDS = xmin=582700 ymin=6060750 xmax=584830 ymax=6062750 #krekenava -BOUNDS = xmin=493674 ymin=6146103 xmax=518869 ymax=6171741 +#BOUNDS = xmin=493674 ymin=6146103 xmax=518869 ymax=6171741 +BOUNDS = xmin=504440 ymin=6154741 xmax=507410 ymax=6158941 +#OUTSIZE = $(shell awk $(addprefix -v ,$(BOUNDS)) 'BEGIN{print ymax-ymin" "xmax-xmin}' /dev/null) +OUTSIZE = $(shell awk $(addprefix -v ,$(BOUNDS)) 'BEGIN{print int((ymax-ymin)/8)" "int((xmax-xmin)/8)}' /dev/null) XYZ = $(patsubst %.zip,%.xyz,$(wildcard 6*.zip)) SORT = sort -n -k2 -k1 -t, @@ -28,7 +31,7 @@ contour_%.gpkg: all.tif gdal_contour -nln $(basename $@) -i $(subst _,.,$*) -a z $^ $@ all-grid.tif: all.vrt all.csv - gdal_grid $< $@ -ot Float32 + gdal_grid $< $@ -ot Float32 -outsize $(OUTSIZE) all.tif: all-grid.tif gdal_translate $< $@ \ diff --git a/contours/Makefile.2017 b/contours/Makefile.2017 index 3efc5de..5e7226a 100644 --- a/contours/Makefile.2017 +++ b/contours/Makefile.2017 @@ -1,8 +1,6 @@ #uzupis -#BOUNDS = xmin=582700 ymin=6060750 xmax=584830 ymax=6062750 -#krekenava -BOUNDS = xmin=493674 ymin=6146103 xmax=518869 ymax=6171741 -XYZ = $(patsubst %.zip,%.xyz,$(wildcard *.zip)) +BOUNDS = xmin=582700 ymin=6060750 xmax=584830 ymax=6062750 +XYZ = $(patsubst %.zip,%.xyz,$(wildcard 6*.zip)) SORT = sort -n -k2 -k1 -t, .PHONY: all @@ -27,19 +25,19 @@ db/contour_%: contour_%.gpkg db/.ready contour_%.gpkg: all.tif gdal_contour -nln $(basename $@) -i $(subst _,.,$*) -a z $^ $@ -all.tif: all.xyz +all.tif: all.csv gdal_translate $< $@ \ -ot Float32 -a_srs EPSG:3346 \ -co COMPRESS=DEFLATE -co PREDICTOR=2 -.INTERMEDIATE: all.xyz -all.xyz: $(XYZ) +.INTERMEDIATE: all.csv +all.csv: $(XYZ) $(SORT) -m $^ > $@ .INTERMEDIATE: $(XYZ) %.xyz: %.zip unzip -qq -c $< $@ | \ - ./clip-2009.awk $(addprefix -v ,$(BOUNDS)) | \ + ./clip-2017.awk $(addprefix -v ,$(BOUNDS)) | \ $(SORT) > $@ db/.ready: managedb diff --git a/contours/all.vrt b/contours/all.vrt index b6346ff..c7caa78 100644 --- a/contours/all.vrt +++ b/contours/all.vrt @@ -1,7 +1,7 @@ EPSG:3346 - all-small.csv + all.csv wkbPoint