Question on queryByAttributes - multiple fields

Cord Thomas cord at LUPINEX.COM
Tue Nov 30 09:33:58 PST 2004


Ahh, yes, something in your documentation that has not made it to the SWIG
Mapscript web site yet - good stuff - thanks.

I now get an error: Can't locate
auto/mapscript/resultCacheObj/swig_shapei.al in @INC

Which means SWIG didnt compile something right in my mapscript.  I am
using MapServer 4.4.0-beta3 and will try pulling the release version now
to see if it compiles differently - but while i am working on this - a
word on why i might have gotten this error despite compiling mapscript
just a week ago?

Cord

> Cord,
>
> Here's something to try (python example):
>
>      # execute queryByAttributes ...
>      results = layer.getResults()
>
> The 'results' variable will either be a reference to the
> layer's result set or be NULL if the query returned nothing.
> The reason why it returned nothing may be found in the
> mapserver error stack
>
>      if results == None:
>          error = mapscript.errorObj()
>          if error:
>                 print error.code, error.message, error.routine
>
>              # continue into the stack
>                     while 1:
>                  error = error.next()
>                  if error == None: break
>                  else:
>                      print error.code, error.message, error.routine
>
> Actually, for Python/Java/Ruby, MapServer errors become language
> exceptions.  For Perl, which has no built-in exceptions, users
> have to program their own error stack inspection.
>
> Sean
>



More information about the MapServer-users mailing list