[mapserver-users] label size based on feature size and no clipping

joel collins jconline at gmail.com
Mon Aug 2 17:03:50 EDT 2010


I am fairly new to mapserver, and i'm trying to create labels very
similar to the ones that you see here:

http://maps.huge.info/zip.htm (type a zip code to see the lables)

Basically, the labels are centered inside the polygons and they very
in size depending on the size of the zip code.

I figured out how to center the labels by adding PROCESSING
"LABEL_NO_CLIP=ON" to the label.  This worked great, except when the
label falls on the border of a tile it is clipped.  (I am not using
tilecache or any other meta-tile technology)

I found that I can say this to remove the labels that would be
clipped, but the problem is that then there are no labels at all for
some polygons!
   WEB
    METADATA
	  #prevents the tiles from having labels rendered on their edges
      "labelcache_map_edge_buffer" "-10"
    END
  END

Questions:
1) how can I display labels at the center of ploygons and still have
them work in the event that the center of a polygon falls on a tile
border
2) I want to display smaller labels for smaller features.  Is the only
way to do this to perform preprocessing on my data to assign size
parameters to each polygon?

Thanks in advance.


More information about the mapserver-users mailing list