[mapguide-users] RE: Wish List

Jim O'Leary joleary.public at gmail.com
Tue Apr 10 16:58:40 EDT 2007


I have implemented Kori's suggestion. In PHP that is:

$area = $geometry->GetArea();

However, the number that I get is:

0.00022107919307102

which does not seem meaningful. I have done some conversion like this in
PostGIS by passing the geometry into SetSRISD(), passing that value into
transform(), and passing that value to Area(). I have used the transform()
method iin MapGuide, but don't see a SetSRID() method.  The map is already
in the default LL84, so I don't see that you would need a transform()
anyway.

Suggestions?



JasonBirch wrote:
> 
> Kori wrote:
>  >  Dim l_dArea as double = l_oMgPolygon.Area
> 
>  
> 
> As Kori mentioned, you could do this pretty easily without a feature
> source:
> 
>  
> 
> $wktReaderWriter = new MgWktReaderWriter();
> $poly = $wktReaderWriter->Read(
>    "POLYGON ( ( 1 1 , 1 2 , 2 1 , 1 1 ) )");
> print $poly->GetArea();
> 
> 
> Note that this doesn't give meaningful results for non-projected
> coordinate systems.  To do this properly, you'd likely want to project
> into an appropriate system (UTM is fairly easy to determine
> programmatically) and run the area calculation on the projected
> geometry.  There would also need to be some unit handling/conversion
> stuff in place for a generic tool, as well as checks to make sure you
> have a valid polygon, etc.
> 
>  
> 
> Jason
> 
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Wish-List-tf2473397s16610.html#a9928492
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list