[postgis-users] postgis mapserver boolean expressions [SOLVED]

Dave Potts dave.potts at pinan.co.uk
Mon Mar 10 14:36:18 PDT 2008


After some hacking

The syntax

    '[castle]'  =~ /t/


Does the trick, horrible and not very clear for the beginner there must 
be a better way of writing a test for  boolean expression!
D.



David Potts wrote:
> Hi
> Is there a problem with the use of the postgres boolean type in mapserver?
>
> I have a data type of type boolean in my database type called castle
>
> I have tried to use the following syntax(see below) , I would have assumed
> that if pt.castle was set to true, then this layer would have been drawn
>
>  STATUS DEFAULT
>                 DEBUG  ON
>                 CONNECTIONTYPE POSTGIS
>                 CONNECTION "dbname=dday_kent user=dp42 host=localhost
> port=5432"
>                 DATA "os_ngr from (
>                         select pt.place_id, pt.place_name,pt.os_ngr as
> os_ngr ,pt.castle as castle, pt.manor
>                         from place_table pt  where pt.os_ngr is not null
>                         )
>                         as foo using srid=27700 using unique place_id"
>                 CLASS
>                         LABEL
>                         SIZE large
>                         OUTLINECOLOR 255 255 0
>                         END
>                         NAME "Castle"
>                         SIZE 40
>                         EXPRESSION  ( '[castle]' eq  't' )
>                         OUTLINECOLOR 0 255 0
>                 END
>
>
> I have tried expresions such as
>
> "[castle] = "1"
> "[castle] = "t"
> "[castle] = "TRUE"
>
> nothing seems to make a difference, the expression always returns false.
>
> I am using mapserver 5.02 and postgis 1.32.
>
> Has anybody seen anything like this before?
>
> Dave.
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dave.potts.vcf
Type: text/x-vcard
Size: 85 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080310/ef99c103/attachment.vcf>


More information about the postgis-users mailing list