<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6618.4">
<TITLE>Re: [mapguide-dev] area calculation conversion to meters</TITLE>
</HEAD>
<BODY dir=ltr>
<DIV>I'm&nbsp;far from an&nbsp;expert either, but here is what makes sense to 
me...</DIV>
<DIV>&nbsp;</DIV>
<DIV>The simplest solution to me seems to transform to the nearest UTM Zone 
projection in meters and compute the area of the resulting geometry. I think 
this will be accurate enough for what you are doing, since it&nbsp;is very 
likely&nbsp;that the original data (for Sheboygan) was measured in that UTM zone 
and then converted to LatLon&nbsp;after the fact anyway. That's why it seems to 
me that this approach will give you exact results, even though in theory it is 
not exact (since the data can be far away from the UTM Zone's central 
meridian).</DIV>
<DIV>&nbsp;</DIV>
<DIV>Another, more generic approach, that would be good for small features, 
would be to construct a UTM coordinate system definition centered around the 
meridian that&nbsp;crosses the centroid of the feature. This will give you an 
LL-UTM transformation with the least distortion for the feature at hand. </DIV>
<DIV>&nbsp;</DIV>
<DIV>My hunch is that computing an exact area on the ellipsoid without 
projection involves elliptical integrals, since even the area of a whole 
ellipsoid involves those. Elliptic integrals have no closed form solution so you 
would need a numerical integration approach, which hurts my head even thinking 
about it.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Traian</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV><FONT size=2>-----Original Message----- <BR><B>From:</B> Paul Spencer 
  (External) <BR><B>Sent:</B> Sat 12/2/2006 12:04 PM <BR><B>To:</B> 
  dev@mapguide.osgeo.org <BR><B>Cc:</B> <BR><B>Subject:</B> Re: [mapguide-dev] 
  area calculation conversion to meters<BR><BR></FONT></DIV>
  <P><FONT size=2>Trevor,<BR><BR>That would work for GetLength() but I wonder if 
  you need to adjust&nbsp;<BR>for latitude as well ... and it doesn't work for 
  area.&nbsp; I pondered&nbsp;<BR>doing this for the square root of the area and 
  then squaring the&nbsp;<BR>result ... I think that would work, but again it 
  would have to be&nbsp;<BR>adjusted for the latitude ... or am I 
  over-engineering this?<BR><BR>Paul<BR><BR>On 1-Dec-06, at 4:10 PM, Trevor 
  Wekel wrote:<BR><BR>&gt; Hi Paul,<BR>&gt;<BR>&gt; For the most general case, I 
  think you're on the right track.&nbsp; Most of<BR>&gt; the geometry classes 
  support the Transform() operation.&nbsp; The<BR>&gt; 
  MgCoordinateSystemTransform allows transformation from one coordinate<BR>&gt; 
  system to another.&nbsp; I'm not a coordinate system expert but from what 
  I<BR>&gt; understand most coordinate systems projections have an accurate 
  sweet<BR>&gt; spot in the center and become more inaccurate around the 
  edges.&nbsp; I<BR>&gt; wonder if there is a programmatic way to determine the 
  appropriateness<BR>&gt; of the target system?&nbsp; Possibly based on center 
  point of the&nbsp;<BR>&gt; projection?<BR>&gt;<BR>&gt; But if your target 
  system is in decimal degrees, doesn't that imply a<BR>&gt; direct mapping to 
  the world space?&nbsp; Isn't a decimal degree some number<BR>&gt; of 
  meters?&nbsp; Could you just use<BR>&gt; 
  MgCoordinateSystem::ConvertCoordinateSystemUnitsToMeters(double units)<BR>&gt; 
  as the conversion factor?&nbsp; I suspect this may also work in the 
  sweet<BR>&gt; spot of projected systems as well.<BR>&gt;<BR>&gt; 
  Thanks,<BR>&gt; Trevor<BR>&gt;<BR>&gt; -----Original Message-----<BR>&gt; 
  From: Paul Spencer (External)<BR>&gt; Sent: Thursday, November 30, 2006 3:03 
  PM<BR>&gt; To: dev@mapguide.osgeo.org<BR>&gt; Subject: [mapguide-dev] area 
  calculation conversion to meters<BR>&gt;<BR>&gt; Hi all,<BR>&gt;<BR>&gt; I'm 
  measuring the area and length of features using<BR>&gt; 
  MgGeometricEntity::GetArea() and GetLength() in the Sheboygan data.<BR>&gt; 
  This returns values in the units of the projection, which 
  happens&nbsp;<BR>&gt; to be<BR>&gt; decimal degrees.&nbsp; Not so 
  useful.&nbsp; I'd like the result to be in meters.<BR>&gt;<BR>&gt; Since this 
  code needs to be generic, I've implemented some stuff to<BR>&gt; transform the 
  geometry into a coordinate system that supports meters.<BR>&gt; This is not 
  too accurate since I arbitrarily picked a World LCC<BR>&gt; projection wkt 
  :)<BR>&gt;<BR>&gt; What is the recommended way of doing this 
  calculation?<BR>&gt;<BR>&gt; Cheers<BR>&gt;<BR>&gt; Paul<BR>&gt;<BR>&gt; 
  +-----------------------------------------------------------------+<BR>&gt; 
  |Paul 
  Spencer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  pspencer@dmsolutions.ca&nbsp;&nbsp;&nbsp; |<BR>&gt; 
  +-----------------------------------------------------------------+<BR>&gt; 
  |Chief Technology 
  Officer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  |<BR>&gt; |DM Solutions Group 
  Inc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <A href="http://www.dmsolutions.ca/">http://www.dmsolutions.ca/</A> |<BR>&gt; 
  +-----------------------------------------------------------------+<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; 
  ---------------------------------------------------------------------<BR>&gt; 
  To unsubscribe, e-mail: dev-unsubscribe@mapguide.osgeo.org<BR>&gt; For 
  additional commands, e-mail: 
  dev-help@mapguide.osgeo.org<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; 
  ---------------------------------------------------------------------<BR>&gt; 
  To unsubscribe, e-mail: dev-unsubscribe@mapguide.osgeo.org<BR>&gt; For 
  additional commands, e-mail: 
  dev-help@mapguide.osgeo.org<BR>&gt;<BR><BR>+-----------------------------------------------------------------+<BR>|Paul 
  Spencer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  pspencer@dmsolutions.ca&nbsp;&nbsp;&nbsp; 
  |<BR>+-----------------------------------------------------------------+<BR>|Chief 
  Technology 
  Officer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  |<BR>|DM Solutions Group 
  Inc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <A href="http://www.dmsolutions.ca/">http://www.dmsolutions.ca/</A> 
  |<BR>+-----------------------------------------------------------------+<BR><BR><BR><BR><BR><BR>---------------------------------------------------------------------<BR>To 
  unsubscribe, e-mail: dev-unsubscribe@mapguide.osgeo.org<BR>For additional 
  commands, e-mail: 
dev-help@mapguide.osgeo.org<BR><BR></FONT></P></BLOCKQUOTE>

</BODY>
</HTML>