[mapguide-dev] area calculation conversion to meters

Trevor Wekel trevor.wekel at autodesk.com
Fri Dec 1 16:10:05 EST 2006


Hi Paul,

For the most general case, I think you're on the right track.  Most of
the geometry classes support the Transform() operation.  The
MgCoordinateSystemTransform allows transformation from one coordinate
system to another.  I'm not a coordinate system expert but from what I
understand most coordinate systems projections have an accurate sweet
spot in the center and become more inaccurate around the edges.  I
wonder if there is a programmatic way to determine the appropriateness
of the target system?  Possibly based on center point of the projection?

But if your target system is in decimal degrees, doesn't that imply a
direct mapping to the world space?  Isn't a decimal degree some number
of meters?  Could you just use
MgCoordinateSystem::ConvertCoordinateSystemUnitsToMeters(double units)
as the conversion factor?  I suspect this may also work in the sweet
spot of projected systems as well.

Thanks,
Trevor

-----Original Message-----
From: Paul Spencer (External) 
Sent: Thursday, November 30, 2006 3:03 PM
To: dev at mapguide.osgeo.org
Subject: [mapguide-dev] area calculation conversion to meters

Hi all,

I'm measuring the area and length of features using  
MgGeometricEntity::GetArea() and GetLength() in the Sheboygan data.   
This returns values in the units of the projection, which happens to be
decimal degrees.  Not so useful.  I'd like the result to be in meters.

Since this code needs to be generic, I've implemented some stuff to
transform the geometry into a coordinate system that supports meters.
This is not too accurate since I arbitrarily picked a World LCC
projection wkt :)

What is the recommended way of doing this calculation?

Cheers

Paul

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: dev-help at mapguide.osgeo.org






More information about the Mapguide_dev mailing list