[mapguide-dev] area calculation conversion to meters

Paul Spencer pspencer at dmsolutions.ca
Sat Dec 2 12:04:29 EST 2006


Trevor,

That would work for GetLength() but I wonder if you need to adjust  
for latitude as well ... and it doesn't work for area.  I pondered  
doing this for the square root of the area and then squaring the  
result ... I think that would work, but again it would have to be  
adjusted for the latitude ... or am I over-engineering this?

Paul

On 1-Dec-06, at 4:10 PM, Trevor Wekel wrote:

> 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
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: dev-help at mapguide.osgeo.org
>

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








More information about the Mapguide-internals mailing list