Thanks, It works using your syntax both with postgis and shape layers. Documentation is not enough clear with about this statement.
Best regards. -----Mensaje original----- De: UMN MapServer Users List [mailto:[EMAIL PROTECTED] En nombre de Kathrin KÖHL Enviado el: viernes, 21 de diciembre de 2007 7:55 Para: MAPSERVER-USERS@LISTS.UMN.EDU Asunto: Re: [UMN_MAPSERVER-USERS] CLASSITEM + EXPRESSION 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, > > Im trying to filter a postgis layer using the statement EXPRESSION. I > think my configuration is fine but doesnt 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 Im going crazy with this piece of code. > > P.S. Of course, Im 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 > No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.5/1191 - Release Date: 20/12/2007 14:14 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.5/1191 - Release Date: 20/12/2007 14:14