[mapserver-users] Keeping labels clear of a specific path

thomas bonfort thomas.bonfort at gmail.com
Tue Dec 1 01:32:01 PST 2015


There is no such functionality explicitly baked into MapServer as far
as I know. You should however be able to force the labelcache to avoid
intersecting labels like this, if you are not too worried about the
performance overhead (YMMV, you probably would want to evaluate the
overhead). I have not tested this.

layer
  name "trails"
  class
   style
    #trail style
   end
   label
    text "[trail_name]"
    angle follow
    size 9
    color 0 0 0
    priority 10
   end
   label
    #force empty characters everywhere else on the line segment
    priority 9 #less than the actual trail label, but more than the
labels from other layers
    text " "
    angle auto
    repeatdistance 1
    size 9
    color 0 0 0
   end
 end
end

This is a rather ugly hack. You can contact me directly if you would
like to fund the implementation of native geometry avoidance for
labels.

--
thomas

On 1 December 2015 at 10:15, Matt McClelland <matt at wildwalks.com> wrote:
> Hi All
>
> I am using mapserver 7 to make maps for a hiking website.
> I am wanting to keep labels from covering the main hiking path for each map.
>
> Labels such at the park name, waypoint names etc tend to sit over the main
> track and at times hide the intersections.
>
> I am using a map file and WMS requests to make the maps
>
> Is there a way to kindly ask mapserver to create a label buffer about a
> particular line feature? (so that no labels are drawn over that line)
>
> thanks
>
> Matt  :)
>
>
> _______________________________________________
> 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