[mapserver-dev] PHP MapScript shapeObj->toWkt() for multipoint shapes returns single point

Mike Leahy mgleahy at alumni.uwaterloo.ca
Sat Sep 6 15:09:08 EDT 2008


Hello List,

I think this might be a bug - but perhaps I'm doing something wrong.  I 
have a PostGIS layer in a mapfile that has multipoint features in it. 
The script I'm using in PHP to query layers by point coordinates 
successfully identifies a multipoint feature no matter which point in 
the geometry I select in the map.  However, the $shapeObj->toWkt() 
function only returns a single POINT wkt result for the first point in 
the object.  I figure this is a bug, since I don't have this problem for 
multipolygon or multiline features - those are properly converted to the 
corresponding MULTI* wkt output.  Has anyone else encountered this?  I'm 
guessing this isn't specific to PHP MapScript.  I'm not sure what I 
could try to fix this...any suggestions?

This led me to further problems.  In order to put together a sample, I 
started creating shapes from WKT text to see what I would get when they 
are converted back to WKT.  In the example below, the first line works, 
but he second line causes PHP to crash with no output (not even errors) 
to the browser:

$oNewSHP = ms_shapeObjFromWkt("POINT(1 1)");
$wkt = $oNewSHP->toWkt();

Could this be a problem with the GEOS library (I have 3.0.0 installed)?

Mike


More information about the mapserver-dev mailing list