Labelling roads

Ramesh Karra karrarm at YAHOO.COM
Thu Mar 2 17:05:05 EST 2006


Hi,

I have POINT data in shape files (.shp, .shx and .dbf)

with shapefiles containing the co-ordinates of the points and .dbf file
containing three field records as

NAME, x-coordinate, y-coordinate

and when I use the following layer in the map file

LAYER
    NAME         ly1
    DATA         lydata1
    STATUS       ON
    TYPE         POINT
    LABELITEM    "NAME"

    CLASS
      NAME       "Points"
      STYLE
 SYMBOL       7
        COLOR        255 255 0
        OUTLINECOLOR 0 100 0
 SIZE      7

      END
      LABEL
    FORCE TRUE
        COLOR 25 25 25
        TYPE TRUETYPE
        FONT verdana
        SIZE 6
        ANTIALIAS TRUE
        POSITION AUTO
        PARTIALS FALSE
        MINDISTANCE 0
        BUFFER 0
      END # end of label
    END
  END

The point and the label are shown correctly on the map.

I want to do the same for roads represented as lines. The shape files
(.shp and .shx) have the co-ordinates and connecting arc data and are
displayed properly. My question is how do I store the label related data
for the line in .dbf file? How many fields need to be stored in  the .dbf
file record? Obviously, all roads are not going to have equal number of
vertices and connecting arcs. How do I represent the line related data and
name in the .dbf file?

Thanks for your help,
Ramesh



More information about the mapserver-users mailing list