#!/usr/bin/perl # PLSS point ids to addresses, for Winnetka IL # Author: Dan Jacobson https://www.jidanni.org/ # Copyright: https://www.gnu.org/licenses/gpl.htm # Created: 2024-02-13T13:27:28+0000 # Last-Updated: 2024-02-18T00:14:58+0000 # Update #: 157 # use strict; use warnings q(all); use PointId2Address; use Data::Dumper; # https://codelibrary.amlegal.com/codes/winnetka/latest/winnetka_il/0-0-0-24508 my @offset; # 1. All lots or buildings located on north and south streets in the # Village or on streets running in a northerly and southerly direction # shall be numbered northerly from a line running east and west one # thousand (1,000) feet south of and parallel with the south section # line extended of Sections 21 and 22, Township 42 north, Range 13 # east, of the third P.M., Cook County, Illinois as a base line, # beginning with the number one and increasing towards the north or # northerly. push @offset, 1000; # 2. All lots or buildings located on east and west streets in the # Village or on streets running in an easterly and westerly direction # shall be numbered westerly from a line running north and south two # thousand (2,000) feet east of and parallel with the east section # line extended of Sections 21 and 22, Township 42 north, Range 13 # east, of the third P.M., Cook County, Illinois as a base line, # beginning with the number one, and increasing toward the west or # westerly. unshift @offset, -2000; if ( $ARGV[0] eq "--observations" ) { ## From looking at https://communitymapviewer.gisconsortium.org/WinnetkaIL my %observations; my $t = < $address, nsew => $nsew, rest => "@rest" }; } for ( keys %observations ) { $observations{$_}{address} += 10000 if $observations{$_}{nsew} eq "N"; # sorting hack } for ( sort { $observations{$a}{address} <=> $observations{$b}{address} } keys %observations ) { my $o = sprintf "%7d %s $_ %s\n", @{ $observations{$_} }{qw/address nsew rest/}; ## next unless $o =~ /SEC/; #section and half section lines s/ $// for $o; warn $o; } print 1260 - 740, " EW$/"; print 10880 - 10362, " NS$/"; exit; } for (@offset) { $_ = $_ / 5280 * 800; } # from village ordinance my %grid = ( ## origin => { ## id => 'IL030420N0130E0_400300', ## address => [@offset] # from ordinance ## }, origin => { # Pure observations fit better id => 'IL030420N0130E0_200340', # corner of Willow & Hibbard address => [ -1260, 362 ] # from observations }, num_per_mile => [ (520) x 2 ] # from %observations # Ah ha! 10 ft. per number, I.e., 20 ft. per number on each side. ); if ( $ARGV[0] eq "--make-targets" ) { #X, Y, Label sub addr_string { my $HV = 0 + ( ref $_[0] eq "ARRAY" ); my @range = @{ $_[ !$HV ] }; my $alignment = $_[$HV]; my $interval = $_[2] || 100; #0 not allowed for (@range) { next if $_ % $interval; printf "%d %d %d$/", $HV ? ( $_, $alignment ) : ( $alignment, $_ ), abs; } } # E-W strings addr_string( [ -1600 .. -700 ], 880 ); # Tower Rd. addr_string( [ -1300 .. -800 ], 625 ); # Pine St. addr_string( [ -1200 .. -500 ], 362 ); # Willow Rd. addr_string( [ -1200 .. -300 ], 100 ); # Hill+Winnetka Roads # N-S strings addr_string( -740, [ 100 .. 500 ] ); # Ridge Av. / section line addr_string( -1260, [ 100 .. 1000 ] ); # Hibbard Rd. addr_string( -900, [ 1000 .. 1100 ] ); # north tip of # village. These are # actually handled by the Glencoe post offices, as "11xx South Sheridan Rd." I recall... #check! # Diagonal double duty N=W ticks for ( 200 .. 800 ) { next if $_ % 100; print join $", -$_, $_, "x$_"; # We'll mark them differently, to hopefully avoid confusion print $/; } } else { # PIDs to addresses while (<>) { chomp; my @F = split /,/; $grid{target} = { id => $F[2] }; #we wipe out any previous {target}{miles} my @p = PointId2Address::id2addr( \%grid ); die "No address for $_" unless @p; my @c; for ( 0, 1 ) { $c[$_] = PointId2Address::canon $p[ 2 * $_ ] . $p[ 2 * $_ + 1 ]; } print join ",", @F[ 0, 1 ], @c; print $/; } }