http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0405/msg00714.html
Aaron
On 6/23/06, Nigel Gilbert <[EMAIL PROTECTED]> wrote:
[Many thanks to those who helped me yesterday overcome a problem with
creating an oid index, now solved as a result of their advice]
I have a PostGIS database including a table, world, with columns,
object_type (containing either one of the strings, 'plants' or 'agents') and
'geom', containing points. In my map file I have:
LAYER
NAME World
CONNECTIONTYPE postgis
CONNECTION "user=..... dbname=...."
DATA "geom from world"
STATUS ON
TYPE POINT
CLASS
NAME Agents
_expression_ ([object_type] = 'agents')
STYLE
COLOR 255 111 207 # pink
END
END
CLASS
NAME Plants
_expression_ ([object_type] = 'plants')
STYLE
COLOR 0 128 64 # green
END
END
END
This gives a map displaying nothing, although if I comment out the
expressions, I get the points I would then expect. In other words, the
expressions are always returning false. But getting the data directly:
select object_type, AsText(geom) from world limit 3;
object_type
| astext
----------------------------------------------------------------------------
--------------------------+----------------
plants
| POINT(13 19)
plants
| POINT(228 840)
plants
| POINT(694 674)
(3 rows)
is fine. What's wrong??
Thanks again!
Nigel
--
+--------------------------------------------
| Aaron Koning
| Information Technologist
| Prince George, BC, Canada.
+--------------------------------------------
| http://datashare.gis.unbc.ca/fist/
| http://datashare.gis.unbc.ca/gctp-js/
+--------------------------------------------
