### Makefile N=Northbrook IL Address Grid ## Author: Dan Jacobson https://www.jidanni.org/ ## Copyright: https://www.gnu.org/licenses/gpl.html ## Created: 2023-12-13T08:35:53+0000 ## Last-Updated: 2024-04-26T01:44:47+0000 ## Update #: 277 ## # Also see ./v2 for newer approach U = ../../../../utilities G=egrep export PERLLIB = $U export PATH := $U:$(PATH) B=~/Downloads/PLSSFirstDivision.geojsonl T=northbrook_il $T_diag.vik: $T_diag.csv:$T0_diag.csv pid2addr diag=1 ./pid2addr $< > $@ $T.csv:$T0.csv pid2addr ./pid2addr $< > $@ #Let's try two runs, on for each axis $T0.csv:$B $U/PLSS_corners_4.pm #First a W-E strip along Lake Cook Rd. $G 'IL030420N0120E0SN0[1-6]' $< |\ intervals=8 sides=3 \ perl -MPLSS_corners_4 -we 'PLSS_corners_4::parse_seq;' |\ $G 700$$ > $@.t #Then a S-N strip along the west side of the township block. #I would have used the 0EW axis, but it falls on a _x4x and I can only #do things along section lines... $G 'IL030420N0120E0SN(06|07|18|19)' $< |\ intervals=8 sides=2 \ perl -MPLSS_corners_4 -we 'PLSS_corners_4::parse_seq;' |\ $G _100 >> $@.t sort -u -o $@ $@.t && rm $@.t #I was also thinking about a diagonal, where X=Y. But for now I can only stick to section lines, #so I'll have to try that on whole counties.. #Wait, as Northbrook only has ONE of its axes on a half section, it just might look dense enough... $T0_diag.csv:$B $U/PLSS_corners_4.pm $G 'IL030420N0120E0SN(01|02|11|10|15|21)' $< |\ intervals=2 sides=0,1,2,3 \ perl -MPLSS_corners_4 -we 'PLSS_corners_4::parse_seq;' |\ sort -u > $@ D=~/IL_CadNSDI_V2.gdb.zip # Yes, we found a wonderful file full of sections $B:$D #And learned we didn't need their centers... ogr2ogr -f GeoJSONSeq $@ -progress -sql "SELECT FRSTDIVID FROM PLSSFirstDivision" $? KO = -f LIBKML \ -dsco NAME="$N" \ -dsco DESCRIPTION="Using BLM PLSS data. See $(subst $(HOME)/,https://www.,$(PWD))" CO= -oo HEADERS=NO \ -oo KEEP_GEOM_COLUMNS=NO \ -oo X_POSSIBLE_NAMES=field_1 \ -oo Y_POSSIBLE_NAMES=field_2 \ -sql 'SELECT field_3 AS Name FROM "$(basename $<)"' %.kmz %.kml:%.csv; ogr2ogr $@ $? $(KO) $(CO) %.vik:%.kmz killall -w viking||: cd /tmp && nohup viking -e $(PWD)/$? & sleep 11 .PRECIOUS: %.kmz