CLASSITEM + EXPRESSION

Kathrin KÖHL kko at NGI.BE
Fri Dec 21 01:55:24 EST 2007


Hi!
I haven't worked with PostGIS yet but with my Shapefiles I use 
EXPRESSION like this:

LAYER
NAME admin
DATA "/mypath/"
TEMPLATE '../templates/'
STATUS ON
TYPE POLYGON
CLASSITEM "NAT"

CLASS
NAME 'Belgium'
EXPRESSION 'BE'
STYLE
COLOR 255 255 255
END
END
CLASS
NAME 'Germany'
EXPRESSION 'GM'
STYLE
COLOR 237 237 237
END
END
END
I define CLASSITEM before in the LAYERobject with the name of the column 
in my data, so MapServer knows where to look for the expression. In the 
CLASSobject I use EXPRESSION with the value that is actually in the 
column for each object that I want to classify.
I'm not sure if it's the same with PostGIS but I don't write the name of 
the column again in the CLASSobject.
Just a guess
Kathrin

Hans Castorp wrote:
>
> Hi to all,
>
> I’m trying to filter a postgis layer using the statement EXPRESSION. I 
> think my configuration is fine but doesn’t works.
>
> Anyone of you detects any trouble on this LAYER statement:
>
> LAYER
>
> CONNECTION "host=localhost dbname=lalin user=??? password=??? port=5432"
>
> DATA "the_geom FROM usos_suelo"
>
> NAME 'USOS SUELO'
>
> GROUP 'USOS SUELO'
>
> TYPE polygon
>
> STATUS ON
>
> TRANSPARENCY 0
>
> CLASSITEM 'clase'
>
> CLASS
>
> NAME 'USOS_ARBORES'
>
> MINSCALE 2500
>
> MAXSCALE 200000
>
> EXPRESSION ('[clase]' = 'ARBORES')
>
> STYLE
>
> ANTIALIAS false
>
> COLOR 162 204 155
>
> END #end style
>
> END # end class
>
> CLASS
>
> NAME 'USOS_CULTIVOS'
>
> MINSCALE 2500
>
> MAXSCALE 200000
>
> EXPRESSION ('[clase]' = 'CULTIVOS')
>
> STYLE
>
> ANTIALIAS false
>
> COLOR 224 224 224
>
> END #end style
>
> END # end class
>
> CLASS
>
> NAME 'USOS_ASENTAMENTOS'
>
> MINSCALE 2500
>
> MAXSCALE 200000
>
> EXPRESSION ('[clase]' = 'ASENTAMENTOS')
>
> STYLE
>
> ANTIALIAS false
>
> COLOR 204 204 204
>
> END #end style
>
> END # end class
>
> END #end layer
>
> Thanks in advance. I think I’m going crazy with this piece of code.
>
> P.S. Of course, I’m sure that ‘clase’ is a column on ‘usos_suelo’ 
> postgis table ;)
>
> Hans Castorp
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.17.5/1190 - Release Date: 
> 19/12/2007 19:37
>



More information about the mapserver-users mailing list