Permalink
Browse files

Discard labels outside image extent when using masks (#5237)

  • Loading branch information...
1 parent c391b86 commit 4196ac38b326ef9dfb03dd62712e7f44928c61f2 @tbonfort tbonfort committed Feb 10, 2016
Showing with 10 additions and 0 deletions.
  1. +10 −0 maplabel.c
View
@@ -372,6 +372,9 @@ int msAddLabelGroup(mapObj *map, int layerindex, int classindex, shapeObj *shape
return MS_SUCCESS;
}
#endif
+ } else {
+ return MS_SUCCESS; /* label point does not intersect image extent, we cannot know if it intersects
+ mask, so we discard it (#5237)*/
}
} else {
msSetError(MS_MISCERR, "Layer (%s) references references a mask layer, but the selected renderer does not support them", "msAddLabelGroup()", layerPtr->name);
@@ -568,6 +571,9 @@ int msAddLabel(mapObj *map, labelObj *label, int layerindex, int classindex, sha
return MS_SUCCESS;
}
#endif
+ } else {
+ return MS_SUCCESS; /* label point does not intersect image extent, we cannot know if it intersects
+ mask, so we discard it (#5237)*/
}
} else if (labelpath) {
int i = 0;
@@ -599,6 +605,10 @@ int msAddLabel(mapObj *map, labelObj *label, int layerindex, int classindex, sha
return MS_SUCCESS;
}
#endif
+ } else {
+ msFreeLabelPathObj(labelpath);
+ return MS_SUCCESS; /* label point does not intersect image extent, we cannot know if it intersects
+ mask, so we discard it (#5237)*/
}
}
}

0 comments on commit 4196ac3

Please sign in to comment.