[Mapserver-users] php mapScript: Problem with LayerObj class - maxfeatures

Inna Janssen innaj at web.de
Fri Jan 9 16:21:45 EST 2004


Hello,

I familiarizing myself with the mapScript language in php, trying out everything and
found a problem: I want to get all shape objects in a layer. I can get e.g. the first one
with $shape = $layer->getShape(-1,0);
But how do I find out how many shapes a layer has? There is the variable maxfeatures.
If I understand it correctly, a feature is only another word  for a shape.
But when I get maxfeatures ($layer->maxfeatures) I only get the  number -1!
When I enter a number above the maximum layer I get a fatal error.
(Fatal error: [MapServer Error]: msLayerGetShape(): Invalid feature id. in ... )

Does anyone know a solution to get the maximum number of shapes?

Inna






More information about the mapserver-users mailing list