[mapserver-users] Label Line Layers Question

Jeshua Lacock jeshua at OpenOSX.com
Mon Jun 2 12:06:23 PDT 2008


Greetings,

I am working on a tutorial for MapServer using a Postgis backend, and  
I just want to check if I am setting a correct example. This is my  
first .map file so please forgive me for my noob question.

Is there a way to have text labels and lines on the same layer?  
Instead of two Postgis queries, I was wondering if it is possible to  
do with a single query.

Here is the pertinent portion of my .map files:

LAYER
   CONNECTIONTYPE postgis
   NAME "roads"
   CONNECTION "user=postgres dbname=ca_hwy host=localhost"
   DATA "the_geom FROM (SELECT roads.oid AS oid, roads.the_geom AS  
the_geom, roads.fename AS fename FROM roads) AS named_roads USING  
UNIQUE oid USING SRID=-1"
   STATUS ON
   TYPE ANNOTATION
   LABELITEM fename
   CLASS
     LABEL
       POSITION auto
       ANGLE follow
       SHADOWCOLOR 120 255 120
       SHADOWSIZE 1 1
       SIZE 8
       COLOR 0 192 0
       FONT sans-bold
       TYPE truetype
       BUFFER 4
       MINDISTANCE 200
       ANTIALIAS TRUE
     END
   END
END

LAYER
   CONNECTIONTYPE postgis
   NAME "roads"
   CONNECTION "user=postgres dbname=ca_hwy host=localhost"
   DATA "the_geom FROM roads USING UNIQUE oid USING SRID=-1"
   STATUS ON
   TYPE LINE
   CLASS
     SIZE 2
     COLOR 0 0 0
   END
END


Thanks,

Jeshua Lacock, Owner
<http://OpenOSX.com>
phone: 877.240.1364




More information about the MapServer-users mailing list