Re: A "How would you do this"-type of question. not Java-specific.



korto.wow@xxxxxxxxx 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?
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?

I can't think of a better approach. The assignment of
ZIP codes (USA postal codes) to geographical location is an
arbitrary encoding -- some large-scale patterns are evident
but they're not regular enough that you could derive map
coordinates from numerical calculations on the codes.[*]
May as well treat them as arbitrary keys and look them up
in a table.

Extrapolation doesn't seem to enter the picture, though.

[*] Mathematically, of course, one could always build a
polynomial of degree 100000 or less that interpolates every
five-digit ZIP code to its latitude, and another polynomial
for longitude. You might, however, have some difficulty in
evaluating such high-degree polynomials with useful accuracy!
In fact, I rather suspect that simply storing the coefficients
(as pairs of BigIntegers representing rational numbers, say)
might take more memory than the average 32-bit JVM can supply.

--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxx

.



Relevant Pages

  • Re: Fields and transcendentals
    ... homomorphism fails to be an isomorphism it's because t is ... since Kis formed by the inclusion of all polynomials in t, ... there be some elements of Kthat map to 0. ... and find a polynomial having t as a root. ...
    (sci.math)
  • Re: Question about "polynomial evaluations"
    ... polynomial functions as opposed to polynomials. ... the map eval cannot be one-to-one. ... you mean "the polynomials that map to the zero ... Fconsists exactly of all multiples of some particular ...
    (sci.math)
  • Re: A "How would you do this"-type of question. not Java-specific.
    ... Eric Sosman wrote: ... a dot will appear on the map to indicate where that ZIP code ... evaluating such high-degree polynomials with useful accuracy! ...
    (comp.lang.java.help)
  • Re: A question on countability proof
    ... I defined the map T to map a polynomial with integer ... coefficients to its coordinate vector representation using the standard ... polynomials is countable, the set of algebraic numbers is countable? ... You have a countable union of finite sets (the finite sets are the ...
    (sci.math)
  • Re: The Algebraic Set
    ... why is the cardinality of A_n less than ... > polynomials, wouldn't the cardinality of A_n be larger than or equal to ... Let be n infinite sequences ... Map to nk + i. ...
    (sci.math)