Class expression and PostGIS

Aaron Koning aaronkoning at GMAIL.COM
Fri Jun 23 23:26:21 PDT 2006


This post may be helpful:

http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0405/msg00714.html

Aaron

On 6/23/06, Nigel Gilbert <n.gilbert at surrey.ac.uk> 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/
+--------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060623/d5b5e212/attachment.htm>


More information about the MapServer-users mailing list