[mapserver-users] Labels for streets

Hankley, Chip Chip.Hankley at GASAI.Com
Mon Dec 10 13:46:40 EST 2001


> How do you 
> 1) get street labels to match the angle of the street 
> (implement rotated fonts)

In the MapServer TestSuite, there is a great example of labeling contours.
This process works well with streets too.

http://maps.dnr.state.mn.us/cgi-bin/mapserv?map=/usr/local/www/docs/mapserve
r_demos/tests/auto_rotate/contours/test.map

Basically, you are going to specify ANGLE AUTO in the label definition.

>, and 2) suppress duplicate labels for every street segment?

I would do some work on the source data... essentially, the labeling is
going to try to label every INDIVIDUAL feature. I don't know that there is a
way to supress duplicates. The easiest way would be to make sure that all of
your line segments that are the same name are "dissolved" into one line.

> While we're at it, is there a way to make the border of a polygon more
than one pixel thick?

Sure, you need to specify a symbol definition, either in a symbol file that
you point to in the header, or in the SYMBOL section of the mapfile.

Here's is a simple symbol definition for a line, we'll make it thick in the
layer definition by using the SIZE feature:

SYMBOL
  NAME 'polygon_outline'
  TYPE ELLIPSE
  POINTS 1 1 END
  FILLED
END

....(some more map file)

LAYER
  NAME "My_Polygon_Shapefile"
  STATUS DEFAULT
  DATA \My_Polygon_Shapefile
  CLASSITEM CODE
  TYPE POLYLINE
  CLASS
    Name 'SomeClassName'
    TEMPLATE "ttt"
    EXPRESSION ''
    SYMBOL 'polygon_outline'
    SIZE 3
    COLOR 255 0 0
  END  # CLASS
END  # LAYER


Cheers!

Chip



More information about the mapserver-users mailing list