This commit is contained in:
Motiejus Jakštys 2020-12-16 08:00:45 +02:00
parent ad0217fec1
commit cbe6b70c00
3 changed files with 12 additions and 11 deletions

View File

@ -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 $< $@ \

View File

@ -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

View File

@ -1,7 +1,7 @@
<OGRVRTDataSource>
<OGRVRTLayer name="all">
<LayerSRS>EPSG:3346</LayerSRS>
<SrcDataSource>all-small.csv</SrcDataSource>
<SrcDataSource>all.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
</OGRVRTLayer>