[mapguide-dev] area calculation conversion to meters
Jason Birch
Jason.Birch at nanaimo.ca
Sat Dec 2 17:06:47 EST 2006
No, you're not over-engineering Paul. I think it's non-trivial to accurately calculate large areas based on decimal degree coordinates because, as you've said, the vertical distance between decimal degrees varies with latitude.
For distance I think there are a couple methods (haversine, cosine law) you can use without having to rely on a projection library. I don't think that the MapGuide ConvertCoordinateSystemUnitsToMeters function (in \Common\Geometry\CoordinateSystem\CoordinateSystem.cpp) is doing the right thing though. For projected systems it's doing a simple multiplication by conversion factor, but it appears to be doing the same thing for geographic systems, multiplying by a constant:
if(m_ogrSrs->IsGeographic())
{
meters = METERS_PER_DEGREE * units;
}
For area, transforming to an equal-area projection would probably work better than a conformal projection like LCC, but I'm unsure of whether "equal area" applies across the entire projection or just within the "sweet spot".
Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4313 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapguide-internals/attachments/20061202/a56ea354/attachment.bin
More information about the Mapguide-internals
mailing list