[mapserver-users] About FILTER and FILTERITEM
Gregor Karzelek
Gregor.Karzelek at heller-ig.com
Wed May 14 06:13:36 PDT 2014
Hi,
As far as I know the Filter is used while data retrieving. At least I have with Postgis and a OSM map FILTER like that:
FILTER "type IN ('rail', 'monorail', 'lightrail‘)"
This is passed 1:1 to the Postgis data source (I checked that) and thus has a huge performance impact as the complete rest of the map config works on less data.
Expression is to distinct between the loaded data for the individual CLASSes.
________________________________
Gregor Karzelek
Systemarchitekt
HELLER Ingenieurgesellschaft mbH
Otto-Hesse-Straße 19 / T3
64293 Darmstadt
Tel.: +49 6151 66846-16
Fax: +49 6151 66846-22
E-Mail: gregor.karzelek at heller-ig.com<mailto:gregor.karzelek at heller-ig.com>
Internet: www.heller-ig.com<http://www.heller-ig.com>
Geschäftsführer: Dipl.-Ing. Henning Balck, Dipl.-Ing. Christian Komma
Handelsregister: Amtsgericht Darmstadt HRB 8310
Ust.-Ident.-Nr.: DE 217 293 137
Am 14.05.2014 um 15:05 schrieb Rahkonen Jukka (Tike) <jukka.rahkonen at mmmtike.fi<mailto:jukka.rahkonen at mmmtike.fi>>:
Hi,
Thank you very much, Christy. By your example I made some tests and now filters like this work for me
FILTER (([WORKERS]>20000000) OR ("[STATE_FIPS]"="17"))
The secret element was the right syntax for string attributes ("[STATE_FIPS]"="17").
Now when I know how it must be used I can find corresponding examples from the expression page of Mapserver documentation. Could someone explain shortly what is the difference between filter and expression? To me they seem to do pretty similar work.
-Jukka Rahkonen-
Christy Nieman wrote:
You do not need to set both FILTERITEM and FILTER. You can just set FILTER to
an expression using as many attributes as you need. e.g.
FILTER (( [POPULATION] < 500000 ) AND ("[DISPLAY]" == "1")). Just like you can
have multiple attributes in a class EXPRESSION.
I think it's the section of the document that is key - the "MapServer Expressions"
section talks about using FILTER and EXPRESSION in more complex logical
expressions, where as the section you quoted is talking about basic string
comparison.
Christy
On 14/05/14 08:03 AM, Rahkonen Jukka (Tike) wrote:
Hi,
>From document page: http://mapserver.org/mapfile/expressions.html
"To use a string comparison for filtering a LAYER, both FILTERITEM and FILTER
must be set. FILTERITEM is set to the attribute name. FILTER is set to the value
for comparison. The same rule applies to CLASSITEM in the LAYER object and
EXPRESSION in the CLASS object."
That would mean that only one attribute from the data can be used for
building a filter. Is this true or just old information living in the document?
-Jukka Rahkonen-
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140514/6584b40c/attachment.htm>
More information about the MapServer-users
mailing list