[mapserver-users] FILTER and MapScript

Armin Burger armin.burger at libero.it
Thu Nov 7 06:18:06 PST 2002


Guillaume,

I think that a filter on alphanumeric fields needs also the field name to be set in single quotes, like

  setFilter("('[$field]'".$operator." '".$value."')")

and for numeric fields no single quotes at all.

I also think that field names for shapefiles need to be in upper case.

Armin


> Hi there,
> I can't get throught setting a filter using MapScript in spite of the
> examples on the list archive.
> No filter nor Filteritem are set in the MapFile.
> the code is :
> $poLayer->setFilter("([$field]".$operator." '".$value."')");
> where operator can be < > <= >= <> or =
> $field the dbf field to compare the value with
> $value the value of the filter

> after execution of this code, all objects of the layer disappear.
> The filter looks a bit strong !



> --
> ---------------------------
> Guillaume SUEUR
> Ingénieur développement SIG
> GEOSIGNAL
> 25bis Avenue Marcel Dassault
> 31505 TOULOUSE CEDEX 5
> ----------------------------






More information about the MapServer-users mailing list