3

I am working with a GeoPackage layer, and cannot figure out why one of my features' label refuses to be shown. I am using only data-defined labeling for this layer, not auxiliary storage. What things can I troubleshoot to find the cause?

Here's what I've already ruled out:

  • Rule-based labeling: labels are displayed by a wordwrap() function; the necessary attributes "name" and "wrap" are correctly populated.
  • "Show all labels for this layer" is selected in Label properties.
  • "Only draw labels which fit completely" and "Discourage labels from covering" are unselected.
  • "Show label" and "Always show": tried setting both to TRUE, without success.
  • Scale-dependent and pixel size-based visibility are unchecked.
  • The geometry is valid according to both Check Validity and Topology Checker.
  • "Simplify geometry" is un-checked in Rendering properties. This is normally the culprit when a single feature is missing its label. If I create a new project containing only this layer, the label WILL be displayed, only if I un-check "Simplify geometry". However, in the project I am using, this does not solve the problem, even after deleting all other layers from the project.

If I split the feature into two new features, the label will show only on the northern of the two. If I split it into two parts of one feature, the label does not show on either part, even if "Label every part…" is selected.

What other settings or conditions will cause a label not to be shown?

  • It's difficult to say without knowing the exact set-up (I'm assuming it's a polygon). I would check the scale related properties and whether the geometry is valid. – Cezar B Jun 12 '18 at 22:21
  • Sorry—multipolygon, yes. There is no scale-dependent or pixel-size visibility setting on the labels, and both Topology Checker and Check Validity show no errors for this polygon. (Other features do come up invalid due to polygons inside other polygons, but their labels display correctly.) I will add these to my list, however, for the benefit of future inquiries! – Nathan Jun 13 '18 at 0:13
  • Maybe it come from the text label itself, check if you have any special character like ' or / that may need to be escaped – J.R Jun 13 '18 at 8:57
1

Answer: the problem was duplicate vertices.

I eventually solved the problem by continuing to split the feature into smaller pieces, until I found a small enough region to manually edit. I found a vertex that was duplicated threefold; by deleting these excess vertices (and re-merging the feature), I was able to make the label appear correctly.

I do not know in what specific cases the presence of duplicate vertices will cause a label not to be displayed, nor why the problem wasn't reproduced by creating a new project with only the polygon layer included, as opposed to an existing project with all other layers removed.

1

I had exactly the same issue: Labels not rendering at appropriate resolution for a single polygon across different layers

Using "Remove Holes" tool solved the issue. Seems to be easier than trying to locate vertices manually.

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.