### Makefile --- 台中市大安﹑大甲區道路有規矩範圍… ## Author: Dan Jacobson https://www.jidanni.org/ ## Copyright: https://www.gnu.org/licenses/gpl.html ## Created: 2024-01-09T02:57:18+0000 ## Last-Updated: 2024-01-10T06:41:38+0000 ## Update #: 134 ## An area shared among Daan and Dajia Districts, Taichung, Taiwan has ## quite regularly spaced and named roads. so let's try to make some ## formulas for them... Alas, no consistent house numbers, so forget ## about that part. # We note that all the roads are in the southwest quadrant. # Road intersections: C=24.3774036 120.6149612 # https://www.openstreetmap.org/node/776161358 #our center of projection 5 ew 5 ns S=24.3659684 120.6121306 #9 ew 5 ns E=24.3725840 120.6380396 #5 ew 1 ns # From az_and_blocks_per_meter A=12.838987 #=102.838987-90 BPMx=0.00166562634421251 BPMy=0.00307987501867174 # put it all together s0=+proj=omerc +alpha=$A +gamma=0 +lat_0=24.3774036 +lonc=120.6149612 s1=+proj=affine +s11=$(BPMx) +s22=$(BPMy) s2=+proj=affine +xoff=-5 +yoff=-5 p=+proj=pipeline +step $(s0) +step $(s1) +step $(s2) ewns.vik: ewns.csv: #Let's just note the spots where the E-W roads meet the same numbered N-S roads, perfectly, perl -wle 'for(4..8){printf "%s %s %s\n", (-$$_) x 2, $(\ )qw/x 一 二 三 四 五 六 七 八 九 十/[$$_];}' | proj -r -f %.6f -I $p|perl -pwle 's/\s+/,/g;' > $@ G=geod +ellps=WGS84 -I -p -f %.6f # We compute the "blocks" are ~ 600 x 324 meters, but we need their inverses: az_and_blocks_per_meter:; for i in "$E e" "$S s"; do echo $C $$i | $G; done | perl -apwle 'print 4 / $$F[-2];' N=_POSSIBLE_NAMES=field_ KO = -f LIBKML -dsco NAME="台中市大安﹑大甲區道路同號交叉點" \ -dsco DESCRIPTION="See $(subst $(HOME)/,https://www.,$(PWD))" CO= -oo HEADERS=NO -oo KEEP_GEOM_COLUMNS=NO -oo X$N1 -oo Y$N2 \ -sql 'SELECT field_3 AS Name FROM "$(basename $<)"' v=viking l.vik: %.kmz %.kml:%.csv; ogr2ogr $@ $? $(KO) $(CO) %.vik:%.kmz if pidof -q $v; then killall -1 $v; else :; fi cd /tmp && nohup $v -e --map 13 $(PWD)/$? & sleep 19 .PRECIOUS: %.kmz