I'm using MapServer 7.6 to render a tiled map using a custom tile grid. Therefore I cannot use MapServer's "tile mode".

I'm rendering a WMS layer that has a text label centerd on each point feature. The label should continue seamlessly over the tile boundary. I'm trying to get MapServer to render also the features that are just outside the tile boundary with the goal to render the partial label on the "other" side of the tile border.

The data is in PostGIS and I'm using a DB function that enlarges the bounding box sent by MapServer (think where geom && enlarged_envelope(!BOX!)). I have verified that the features returned by the DB indeed correspond to an enlarged area.

Even with the features beyond the border being returned, MapServer still does not render any labels whose point geometry is outside of the tile. There seems to be further spatial filtering going on after the filtering in the DB query. Is there a way to force rendering of labels anchored outside of the requested WMS bbox?

I'm aware of the option to metatile & buffer in some program outside of MapServer, but I would prefer to avoid adding the complexity and overhead.

  • Do you allow partial labels in your mapfile?
    – user30184
    Dec 8, 2021 at 13:49
    – data-ux
    Dec 8, 2021 at 16:57

2 Answers 2


The upcoming MapServer 8.0 release will also accept "&TILED=TRUE" for WMS GetMap requests, which will allow you to specify in your mapfile's METADATA object a "tile_map_edge_buffer" parameter such as:

      "tile_map_edge_buffer" "100"

Read more about that upcoming feature at https://github.com/MapServer/MapServer-documentation/pull/533/files

Hope that helps,

developer/maintainer of MS4W
MapServer PSC

PS. oh! subtle hint: if you happen to be on Windows, the big MS4W 5.0 release is imminent (with alphas and betas already out in the wild) that already contains this!

  • Great to hear that this feature is coming!
    – data-ux
    Dec 22, 2021 at 10:44

As far as I know MapServer does not support such buffered label rendering of point features with WMS. Mode=tile has configuration options for edge buffer and metatiles https://www.mapserver.org/output/tile_mode.html but because of your tiling schema you can't use tile mode.

The MapProxy documentation https://mapproxy.org/docs/latest/labeling.html explains well the problem and how to deal with it but then some tile proxy server like MapProxy, MapCache, or GeoWebCache would be needed. Another option would be to make your own application that would make make oversized WMS requests and trim the tiles before saving them according to your tiling schema. I am not sure if that would makes sense, probably there would be as much additional complexity than with ready made proxy servers.

The developers choice might be to have a look at how the mode=tile is implemented in MapServer and consider if it could be enhanced to support also other tiling schemas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.