From e9c23a6ded504be7b268a60874b74b740ad1b604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 16 Dec 2020 00:12:25 +0200 Subject: [PATCH] add clip-2009.awk --- contours/Makefile | 3 +-- contours/clip-2009.awk | 7 +++++++ contours/{clip.awk => clip-2017.awk} | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 contours/clip-2009.awk rename contours/{clip.awk => clip-2017.awk} (50%) diff --git a/contours/Makefile b/contours/Makefile index 6530379..3efc5de 100644 --- a/contours/Makefile +++ b/contours/Makefile @@ -39,8 +39,7 @@ all.xyz: $(XYZ) .INTERMEDIATE: $(XYZ) %.xyz: %.zip unzip -qq -c $< $@ | \ - sed -e 's/^ \+//' -e 's/ \+/,/g' | \ - ./clip.awk $(addprefix -v ,$(BOUNDS)) | \ + ./clip-2009.awk $(addprefix -v ,$(BOUNDS)) | \ $(SORT) > $@ db/.ready: managedb diff --git a/contours/clip-2009.awk b/contours/clip-2009.awk new file mode 100755 index 0000000..0b02549 --- /dev/null +++ b/contours/clip-2009.awk @@ -0,0 +1,7 @@ +#!/usr/bin/awk -f + +# this file works with SEZP from circa 2009, where x coordinate (the 6-digit one) +# is first, and the field separator is ' ' or more spaces. +$1 > xmin && $1 < xmax && $2 > ymin && $2 < ymax { + print $1 "," $2 "," $3 +} diff --git a/contours/clip.awk b/contours/clip-2017.awk similarity index 50% rename from contours/clip.awk rename to contours/clip-2017.awk index 3d677b0..5ed6b6f 100755 --- a/contours/clip.awk +++ b/contours/clip-2017.awk @@ -1,4 +1,7 @@ #!/usr/bin/awk -f +# +# this file works with SEZP circa ~2017 where y coordinate (the 7-digit one) is +# first, and the field separator is ',' BEGIN { FS = "," }