Catching error of getShape - php_mapscript
Julien-Samuel Lacroix
jlacroix at DMSOLUTIONS.CA
Thu Jun 16 07:59:48 PDT 2005
Hi,
With Mapscript there's the errorObj object that can do exactly what you
want I think. There's an example of how to use it in the doc.
http://mapserver.gis.umn.edu/doc44/phpmapscript-class-guide.html#errorobj
Julien
On 06/16/2005 03:04 AM, Jacob Delfos wrote:
> 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_
>
--
------------------------------------------------------------
Julien-Samuel Lacroix jlacroix at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
More information about the MapServer-users
mailing list