[mapserver-users] expressions for Postgis layers
Mike Leahy
mgleahy at alumni.uwaterloo.ca
Wed Aug 27 21:43:46 PDT 2008
Hello list,
I'm having a bit of trouble setting up expressions for a PostGIS layer.
The layer is fine if I set the CLASSITEM property for the property,
and set the EXPRESSION equal to specific values. However, I'd like to
be able to use more complex expressions based on one or more fields in
the layer. Unfortunately, I can't seem to get it to work just with a
single field. Below is an example of a layer in my mapfile - previously
it was classified using the field 'lcdb1name' as the classitem. I tried
rewriting the expression (see below), but I just get a blank image - no
error messages. I'm fairly sure that I've done this before...maybe
somebody can spot what I've missed?
Thanks for any help,
Mike
================================
LAYER
NAME 'Land Cover Database'
TYPE POLYGON
CONNECTIONTYPE postgis
CONNECTION 'host=localhost user=postgres dbname=testdb port=5432'
DATA 'the_geom FROM lcdb_test'
STATUS ON
#CLASSITEM 'lcdb1name'
CLASS
NAME 'High Producing Exotic Grassland'
#EXPRESSION "High Producing Exotic Grassland"
EXPRESSION "('[lcdb1name]' = 'High Producing Exotic Grassland')"
STYLE
OUTLINECOLOR 192 192 192
COLOR 170 255 0
END
END
END
More information about the MapServer-users
mailing list