Catching error of getShape - php_mapscript

Jacob Delfos jacob.delfos at MAUNSELL.COM
Thu Jun 16 00:04:32 PDT 2005


Hi all,

Can anyone tell me if there is a way to catch the error that getShape throws if you request a shape that is out of range? 

Reason is I'm trying to iterate through a layer. At this stage, I need to use an object count to make the loop stop. Getting an object count either requires me to use the shpfileobj->numshapes variable (which obviously only works on shapefiles), or doing a query (which would only work on layers with templates, which would need a reprojected rectangle, uses overhead, etc..).

Would it be possible to make getShape return MS_FAILURE if the object is out of range, or throw a warning that can be caught using '@' error suppression? That way one could iterate through a whole layer without needing a layer count.

Regards,

Jacob



JACOB DELFOS
SPATIAL INFORMATION ANALYST
Maunsell Australia Pty Ltd
629 Newcastle Street, Leederville, WA 6007

PO Box 81, Leederville, WA 6902

Western Australia

ABN 20 093 846 925

Tel     + 61 8 9281 6185
Fax    + 61 8 9281 6297
jacob.delfos at maunsell.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050616/f02115cf/attachment.htm>


More information about the MapServer-users mailing list