[cairo] cartographic projection

Tor Lillqvist tml at iki.fi
Fri Oct 5 09:01:09 PDT 2007

> perhapses I could just use some clever cairo scaling and just use the lat/long for my cairo x/y.

Yes and no. If the area is small (like some tens of kilometres
across), sure. Just scale your longitude values by, umm, 1/cos(lat)
(sorry if I got this wrong, not bothering to check now), etc.

But otherwise, if you need more precision, and/or have a larger area,
you really need to read up on geographic projections. It's a very
interesting subject. Once you have browsed more introductory tutorials
on the web, I can recommend
http://onlinepubs.er.usgs.gov/djvu/PP/PP_1395.pdf .

> Cartography and matrices are not really my thing.

It's not really my thing either, but I have dabbled a little with this
stuff just for fun in my spare time. (Lately related to MS Flight
Simulator addons...)

Matrix algebra is not really needed for projection calculations, at
least as they usually are presented. Trigonometric functions are, and
if you use an ellipsoid model for the Earth (as you should),
hyperbolic functions. You don't really need to derive any formulae
yourself, though, all can be found in on-line publications, presented
in more or less easy to understand ways.


More information about the cairo mailing list