Filter help, string expression
Steve Lime
Steve.Lime at DNR.STATE.MN.US
Wed Feb 21 09:54:10 PST 2007
MapServer doesn't handle nulls all that well. Various data drivers do
things differently
which complicates things. For example, for some NULL means an empty
string.
Anyway, you might try something like this instead:
FILTERITEM "FENAME"
FILTER /./
This tests to see if there is at least one character in the FENAME
attribute. It should
evaluate faster too.
Steve
>>> Scott Schulthess <scott at TOPOZONE.COM> 2/20/2007 1:14:16 PM >>>
I'm trying to use the filter command in my mapfile make mapserver not
draw a street if one of it's attributes (the street name) is null.
I have tried using this
FILTER ("[FENAME]" != "(NULL)")
That's what it looks like in the dbf file - (NULL) when there is no
name. However it just doesn't draw anything for that layer.
Here's the layer definition and one class
LAYER
METADATA
"wms_srs" wmsEPSGNAD83
END
NAME "US Streets"
GROUP US_POINTLINE
STATUS OFF
DATA "str"
PROJECTION
"init=epsg:4326"
END
TILEINDEX "us_streets/county_index"
TILEITEM "location"
TYPE LINE
SIZEUNITS PIXELS
TRANSPARENCY ALPHA //test
FILTER ("[FENAME]" != "(NULL)")
CLASS
NAME "US Streets"
MINSCALE 99001
MAXSCALE 190000
STYLE
SYMBOL "circle"
COLOR 183 176 169
SIZE 4
ANTIALIAS TRUE
END
STYLE
SYMBOL "circle"
COLOR 254 254 254
SIZE 2
ANTIALIAS TRUE
END
END
Tips?
-Scott
More information about the MapServer-users
mailing list