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 = "," }