[mapguide-users] Feature Vertices (Solution)

Tom Lazo / Stygy tom.lazo at hotmail.com
Thu Jul 9 13:16:44 EDT 2009


Hi all, 

I just want to share my solution with people having the same problem.

//--------------- This is a way to get the coordinates of the vertices of a
feature

                                $featureReader->ReadNext(); 
                                $byteReader =
$featureReader->GetGeometry("Geometry"); 
                                $geometryReaderWriter = new
MgAgfReaderWriter(); 
                                $geometry =
$geometryReaderWriter->Read($byteReader); 
                                $polygon = $geometry->Boundary(); 
                                $area = $polygon->GetArea(); 
                                $coordIter = $polygon->GetCoordinates(); 
                                
                                while ($coordIter->MoveNext()){ 
                                  $coord = $coordIter->GetCurrent(); 
                                  $coordX = $coord->GetX(); 
                                  $coordY = $coord->GetY(); 
                                  echo "$coordX $coordY \n "; 
                               } 

Hope it helps..

Tom

-----
http://n2.nabble.com/file/u222842/warning.png   Stygy is not a living being!
-- 
View this message in context: http://n2.nabble.com/Feature-Vertices-%28Solution%29-tp3232857p3232857.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list