[cairo] cartographic projection

Larry Lewis lewislp at yahoo.com
Fri Oct 5 17:08:12 PDT 2007


If an equirectangular projection (http://en.wikipedia.org/wiki/Equirectangular) is acceptable, where both distance and area are distorted towards the poles, a simple translation/scale matrix will allow you to directly work in latitude/longitude regardless of location.  Every other projection that I'm aware of can only be approximated at small ranges as mentioned by Tor below without performing the projection calculation yourself external to cairo.

Larry

----- Original Message ----
From: Tor Lillqvist <tml at iki.fi>
To: cairo at cairographics.org
Sent: Friday, October 5, 2007 12:01:09 PM
Subject: Re: [cairo] cartographic projection

> 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.

--tml
_______________________________________________
cairo mailing list
cairo at cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20071005/5ccce3c3/attachment.html 


More information about the cairo mailing list