[Mapserver-users] mapscript setFilter

Michael Schulz mschulz at webgis.de
Thu Mar 6 07:23:09 EST 2003


Hi,

just to close this thread: the problem was solved, by explicitly putting
double quotes around the filterstring. Well, perhaps obvious.

Instead of (python/mapscript):
  filterliststring = 'columnname like \'%' + value + '%\''
i had to use:
  filterliststring = '\"columnname like \'%' + value + '%\'\"'

Michael


Michael Schulz schrieb:

> Hi,
> i have a problem with filterstrings that are passed to the layerobj's
> setFilter method.
>
> The setup:
> mapserver37, python/mapscript and Oracle SDO data (only points).
>
> The problem:
> When i use setFilter() with a rather simple filterstring like
> "db_ora_attribute=1" then the filter is correctly applied (meaning i can
> draw the map with the oracle layer only displaying the filtered
> geometries). When i want to pass a more complex filterstring like
> "db_ora_attribute like '%a%'" then i can set the filterstring
> (layerBj.setFilter(filterstring) returns 0) but when i want to draw the
> map, no imageObj is created. I think i have tried nearly every possible
> combination of escape sequences or differently nested string delimiters
> i could think of.
>
> If i use the same complex filterstring in the mapfile as an explicit
> layer FILTER then everything works fine. The problem seems related to
> the handling of strings that contain string delimiters when using python
> mapscript. Or has anybody experienced a similar problem e.g. with
> php/mapscript or perl/mapscript?
>
> Thanks, Michael
>
> --
> -----------------------------------------------------------
> Michael Schulz                                in medias res
> Dipl.-Geologe                              Gesellschaft für
>                                 Informationstechnologie mbH
>                              Sautierstr. 38, 79104 Freiburg
>                                      0761 55695-95 (Fax 96)
> mschulz at webgis.de                             www.webgis.de
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

--
-----------------------------------------------------------
Michael Schulz                                in medias res
Dipl.-Geologe                              Gesellschaft für
                                Informationstechnologie mbH
                             Sautierstr. 38, 79104 Freiburg
                                     0761 55695-95 (Fax 96)
mschulz at webgis.de                             www.webgis.de





More information about the mapserver-users mailing list