Got it- use the wrong syntax.  Instead of:
$centroid(x)...

Should have used:

$centroid->x ...


From: Bistrais, Bob
Sent: Tuesday, February 05, 2013 3:29 PM
To: mapserver-users@lists.osgeo.org
Subject: Getting centroid coords

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?
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to