[Mapserver-users] #features for layer in php/mapscript?

Daniel Morissette morissette at dmsolutions.ca
Mon Apr 28 23:14:45 EDT 2003


woodbri at swoodbridge.com wrote:
> 
> Vincent,
> 
> $oShp = $layer->getshape()
> $num = $oShp->numshapes;
> $shptype = $oShp->type;
> etc
> 
> See the shapeObj in the php/mapscript doc.
> 

(Humm... there is no numshapes member on shapeObj, but there is one in
the shapeFileObj which is what Vincent should look at using.)

To answer the initial question, no there is no way to get a numshapes
using the $layer->open() and $layer->getshape() methods.  Those methods
were initially intended for use to fetch query results only.  It would
not be easily possible to provide a getNumShapes() on the layerObj due
to the various types of datasources supported.  However, it would be
possible, and perhaps desirable to add a $layer->getNextShape() ... you
might want to file this as an enhancement in bugzilla.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the mapserver-users mailing list