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