It seems as if there is a border problem when masking out labelled layers. Sometimes labels at the very edge of the map leak through even when they should definitely be masked away.
The above dataset masked with a mask which is a union of the polygons at the centre of the map:
Geometries are correctly masked, but note the label "Nørre Broby".
Adding PROCESSING FORCE_DRAW_LABEL_CACHE=FLUSH in the last layer before the mask, or in a dummy layer with status default before the mask (to ensure that it is always on) should solve this. See #5100
@dmorissette I think this is a bug in the masking code, not something related to labelcache flushing. reopening.
Sorry about this.
Discard labels outside image extent when using masks (#5237)
No problem. I was reading through #5100 and didn't really understand the connection :-)
@AsgerPetersen can you apply 3eeeeed from my repo and report back ?
further fixes for #5237
@AsgerPetersen you'll also need b1dfd3b
@tbonfort Thank you very much! We will give it a spin first thing tomorrow.
I've tested the additions in the issues/5237-masked-labels-bug-branch, and I can confirm that it's indeed working.
Here's a request against the released version of mapserver 7:
And the same request against a build of the fixes in issues/5237-masked-labels-bug:
applied to branch-6-4 in 4196ac3. This was happening on polygons that where close to the image border when the label-point was computed to be outside of the image extent.
also applied by merging to branch-7-0 in 6c13c20 and master in 27fb2d1
Thank you @tbonfort. Highly appreciated!