-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1> On Sat, Aug 05, 2000 at 07:36:14PM -0400, James Caple wrote:
My question is, does anyone know of an elegant algorithm or way to
properly transpose these lat/long.
coordinates to x,y coordinates of a given drawing area?
I’ll drift a bit off-topic myself here…
You’ve stumbled into a very tricky problem in mathematics and
cartography that there isn’t one right answer to. If you are going to
project an image from the surface of a sphere (like the earth) to a
place (like a piece of paper, or a monitor), you necessarily have to
introduce distortions. There are a bunch of different schemes for
doing this, each with different properties.
One of the most standard is the Mercator projection, which has some
properties that make it suitable for nautical navigation. It is a
“conformal mapping”, which means that angles are preserved under the
transformation. However, it distorts area rather badly as you move
away from the equator. (These are the maps that make Greenland and
Antarctica look really huge.)
There are also a family of projections that preserve the relative
areas of mapped objects, Given the forum, I’d be remiss not to mention
the Gnomonic projection, which distorts areas and angles but has the
nice property of mapping spherical great circles into straight lines.
There are a whole bunch of different methods, some of which have nice
mathematical/cartographic properties but produce pictures that are
really strange-looking.
Luckily, there is a good source of information about this stuff on the
Internet. Map Projections -- from Wolfram MathWorld
gives formulas for (long,lat) → (x,y) conversions for many different
projections and shows examples of the globe under the various
transformations. You can look through the many different options
and pick the one you like the best.
I have code doing these kinds of projections, based on Pascal code from
a very old article from Byte Magazine I saw more than ten years ago…
Fortunately, I still have my C conversion of it, but it uses Motif and
Xlib for the display; never got around to updating it to use GTK+ or
something like that. It currently supports Mercator, Equidistant
Cylindrical, Miller, Sinusoidal, Hammer, Orthographic, and Stereographic
projections. I can email this code (which includes a digitized map of the
world with 7574 world coastline points) to anyone who’s interested.
The article was by Robert Miller and Francis Reddy: “Mapping the World in
Pascal”, BYTE Magazine, December 1987, page 329.
Rafael R. Sevilla <@Rafael_R_Sevilla> +63 (2) 4342217
ICSM-F Development Team, UP Diliman +63 (917) 4458925
PGP Key available at http://home.pacific.net.ph/~dido/dido.pgp
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.1i
iQA/AwUBOY0hoGqsapcaCwm7EQLNoQCfcW6fib/v5MDqoh+Snya2DdouITMAn2c7
zCCNd2jionRTblMWPIWX7FKs
=skwb
-----END PGP SIGNATURE-----