[mapserver-users] [SOLVED] Re: Filtering NULL values from Postgis Layer in Mapserver 7
deduikertjes
DeDuikertjes at xs4all.nl
Thu Aug 18 01:34:12 PDT 2016
Steve,
thank you
Lime, Steve D (MNIT) wrote
> The filter option is still there - it's just implemented as a processing
> option instead. So what was:
>
> FILTER 'myitem != NULL'
>
> Becomes:
>
> PROCESSING 'NATIVE_FILTER=myitem != NULL'
>
> Steve
I can confirm that making the FILTER a PROCESSING option indeed works, even
with runtime substitution. (using = NULL does not work, IS NULL must be
used)
So the mapserver6 style line:
FILTER (NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL))
in mapserver 7 becomes:
PROCESSING 'NATIVE_FILTER=(NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL))'
So I summarize:
- CLASS EXPRESSIONS will treat NULL values in numerical fields as zero
(and I presume it does the same for empty numeric fields in shapefiles). It
is not possible to prevent this behaviour.
- To prevent NULL values from being rendered a FILTER must be applied, or
a subselect in the DATA statement must be used.
- In mapserver 6 that can be a native filter with a syntax like FILTER
(NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL))
- In mapserver 7 that filter must be added as a processing option with a
syntax like PROCESSING 'NATIVE_FILTER=(NOT (%MY_VAR1% IS NULL OR %MY_VAR2%
IS NULL))'
It still would be very nice to have an option to ignore empty fields/ NULL
values/ missing values like -9999 with a single config option. Shall I file
a feature request for that?
MArco
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Filtering-NULL-values-from-Postgis-Layer-in-Mapserver-7-tp5280893p5281145.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
More information about the MapServer-users
mailing list