[mapguide-users] How to get coordinates?

Andy Morsell amorsell at spatialgis.com
Mon Feb 26 12:04:43 EST 2007


If you just want the first coordinate, try something like this on the
MgCoordinateIterator:

 while ($punktE->MoveNext())
(
$currCoord = $punktE->GetCurrent();
$currX = $currCoord->GetX();
$currY = $currCoord->GetY();
)

You'll have to add some logic to break out of the while loop after
retrieving your first coordinate. 


Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of peter56
Sent: Monday, February 26, 2007 2:56 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] How to get coordinates?


Hi,

I am currently trying to iterate through the coordinates of a selected line,
but I don't konw how.

For center points I found examples, but not for lines.

$featureReader = $featureService->SelectFeatures($srcId, $featureClass,
$Optionen); $featureReader->ReadNext(); $byteReader =
$featureReader->GetGeometry("Geometry");
$geometryReaderWriter = new MgAgfReaderWriter(); $geometry =
$geometryReaderWriter->Read($byteReader);
$geotyp = $geometry->GetGeometryType();
echo "Geometrietyp $geotyp <br>\n";
$punktE = $geometry->GetCoordinates();

The code runs until the last line. But how to get the current coordinate?
Finally I want zoom to the first coordinate of the line.

Any suggestions (examples!?) would be appreciated.

Thanks in advance - Peter



--
View this message in context:
http://www.nabble.com/How-to-get-coordinates--tf3292100s16610.html#a9156826
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users





More information about the mapguide-users mailing list