[mapserver-users] Getting centroid coords

Bistrais, Bob Bob.Bistrais at maine.gov
Tue Feb 5 12:28:47 PST 2013


This seemed like a simple one but I am having problems.  I am trying to get the X and Y of a centroid, and display it to console.  I keep getting errors instead.  Here is the code:
$centroid=ms_newPointObj();
$oShape=$searchLayer->getShape($oResult);   //$oShape is a result from a queryByAttributes which I know is returning valid results
$centroid = $oShape->getCentroid();

print "Centroid=". $centroid(x).",". $centroid(y);

The error message from FireBug:
Fatal error: Function name must be a string in C:\htdocs\php\streamprocessBak3.php on line 75

-How do I get the X and Y to print?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130205/fc98a051/attachment.htm>


More information about the MapServer-users mailing list