Mapfile Expression NULL value

Steve Lime steve.lime at DNR.STATE.MN.US
Tue Mar 7 12:32:17 EST 2006


That'd certainly fix it. You could also use a case statement in PostGIS to assign
NULLs a more useable (from MapServer's point of view) value and then test
for that value in an expression.

Steve

>>> Emmanuel BELO <emmanuel.belo at MICROGIS.CH> 03/07/06 4:47 AM >>>
Hi Steve, thank you for your answer but with PostgreSQL/PostGIS it 
doesn't work.

For now, the solution is to add a WHERE clause in the SQL statement:

  WHERE tx_femme IS NOT NULL

best regards,

eb

Steve Lime wrote:
> It really depends on how your datastore coughs up the data. I don't believe
> there is a true NULL with DBF files but I may be wrong. You might try 
> expressions like:
> 
>   EXPRESSION (not '[tx_femme]')
>   EXPRESSION ('[tx_femme]' = '')
> 
> Steve
> 
>>>> Emmanuel BELO <emmanuel.belo at MICROGIS.CH> 03/06/06 9:11 AM >>>
> Hi,
> 
> how do you handle NULL values from you database in your mapfile's 
> expression?
> 
> Example (NULL value for some tx_femme):
> 
>   CLASS
>      EXPRESSION (([tx_femme] > 8) AND ([tx_femme] <= 15))
>      NAME "8 - 15"
>      STYLE
>        COLOR 255 217 0
>      END
>    END
> 
> I've tried:
> 
> EXPRESSION ('[tx_femme]' = 'NULL')
> 
> EXPRESSION /_always_false_/
> 
> Best regards,
> 
> Emmanuel BELO
> 
> 
> 



More information about the mapserver-users mailing list