Re: A "How would you do this" type of question.
- From: "Gene" <gene.ressler@xxxxxxxxx>
- Date: 27 Sep 2006 17:29:10 -0700
Korto wrote:
Imagine you are writing a program that will display a map of the United
States. Your program will ask a user to input their ZIP code. Once
they do, a dot will appear on the map to indicate where that ZIP code
is located.
My question is, how would you go about doing something like this, in
general?
Would you have a file of all ZIP codes and their longitude, latitude
coords and extrapolate those to x,y coords on your graphic map? Or, is
there an easier way?
Thanks,
Korto
No. But it's easy to get the complete list of zip codes and
corresponding lat-lon coordinates in a flat file for a few dollars from
one of several web sites. You can sort this on zip and use binary
search to find any zip very quickly. Plotting lat-lons on a map
requires the same projection transformation used for the map. It's
tedious to get all the details of this right. But it's already done
for you, at least in Perl. See
http://search.cpan.org/~lgoddard/Image-Maps-Plot-FromLatLong-0.12/FromLatLong.pm
..
An example of a map done this way is
http://bridgecontest.usma.edu/reports/teammap_small.png
All the best,
Gene
.
- References:
- A "How would you do this" type of question.
- From: Korto
- A "How would you do this" type of question.
- Prev by Date: Re: A "How would you do this" type of question.
- Next by Date: Re: What programming language for a Republican?
- Previous by thread: Re: A "How would you do this" type of question.
- Next by thread: Re: A "How would you do this" type of question.
- Index(es):
Relevant Pages
|