
Find Nearby Things Using U.S. ZIP Codes #82
Chapter 7, Names and Places
|
413
HACK
last;
}
}
# no extra whitespace
$addr =~ s/\s+/ /igs;
return $addr;
}
—Michael Frumin
HACK
#82
Find Nearby Things Using U.S. ZIP Codes Hack #82
ZIP Codes are everywhere, and ideal for taking advantage of “What’s near
me?” services.
Everywhere on the Web are forms asking for your ZIP Code and promising
to get you in touch with your nearest latte, sandwich, or golf course. Now
you can join the in-crowd and provide your own Location Based Services
(LBS) based on ZIP Codes.
If you know your ZIP Code, then you can figure out where you are...sort of.
United States ZIP Codes were established to help deliver the mail. They
were not optimized to ease the burden of 21st century geowankers, which is
a pity, since they provide a ubiquitous and useful label for most people in
the United States. There is a method to the madness of U.S. ZIP Codes, but
sadly for those of us with a locative bent, that method has nothing to do
with topography and everything to do with efficient mail delivery.
ZIP Codes describe arbitrary, irregular shapes and sizes. Similar ZIP Codes
tend to be close to each other, but there are places where successive ZIP
Codes are spread across metropolitan areas. Because the boundaries are
irregular, it is quite possible to be in one ZIP Code on the border of a sec-
ond ZIP Code, and to actually be closer to a third ZIP ...