[mapserver-users] attach text to displayed features thatare comingfrom postgis

Fawcett, David David.Fawcett at state.mn.us
Mon Aug 18 12:07:04 PDT 2008


To be able to use a label, you will likely also have to modify your
select statement to include the columns that you want to use in labels
or expressions.  

Try something like:

DATA "the_geom from (select myLabelColumn, the_geom from myTable) as foo
using
unique gid using SRID=4326"


Of course, you will want to make sure that you are specifying the actual
names of your unique id column and your SRID.  

David.

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Steve Lime
Sent: Monday, August 18, 2008 1:31 PM
To: John Mitchell; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] attach text to displayed features thatare
comingfrom postgis


Check out the LABELITEM property for a layer. You'll also need to define
a LABEL for your class.

Steve

>>> On 8/18/2008 at 11:17 AM, in message
<fa2ac0580808180917h484b2524h58141eb88f6480a8 at mail.gmail.com>, "John
Mitchell" <mitchelljj98 at gmail.com> wrote:
> Hi,
> 
> I would like to be able to attach text to displayed features that are 
> coming from postgis.  Currently I am just displaying points (layer 
> displayed below) as an ellipse from postgis, but I would like to have 
> text on top of each ellipse based on the contents of a field uniquely 
> associated to each point.
> 
> John
> 
>  LAYER
>   # name of layer
>   NAME "gv:tasmania_cities"
>   GROUP "Collaboration"
> 
>   # what type of data is this?
>   TYPE POINT
> 
>   # always returned with interface
>   STATUS ON
> 
>   TRANSPARENCY 100
> 
>   CONNECTIONTYPE postgis
> 
>   CONNECTION "user=postgres dbname=gvdb host=localhost port=5432 
> password=password1117"
>   DATA "the_geom from tasmania_cities"
> 
> 
>   CLASS
>     STYLE
>         symbol "dot"
>         SIZE 8
>           COLOR 0 0 0
>     END
>    END
>  END
> 

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list