4

I want to label nodes of my polygon with upper letters. I got to the point where I am able to label them with the right style. What I still need to do is to dismiss the final letter because it overlays the first letter, see the following screenshot where you can see that Q (the last label) overlays A (the first label):

enter image description here

Here is my expression :

CASE WHEN @geometry_part_num <27 THEN upper(char( @geometry_part_num-1+97)) WHEN @geometry_part_num <677 THEN concat(upper(char( to_int( (@geometry_part_num-1)/26 + 96))) , upper(char( to_int((@geometry_part_num-1)%26 + 96)))) END
  • Why do you have two points in the same vertex? – Jhon Galindo Jun 4 at 17:31
  • i think every polygon behave like this ... i mean closing polygons implies having start and end points overlapping ... – snaileater Jun 4 at 17:47
7

For the benefit of readers, it is not really a label, but rather a font marker.

To get access to the polygon vertices, we must use nodes_to_points, which accepts a geometry. The second parameters instructs the function to ignore repeating vertices. As it is false by default (i.e. do consider all vertices), the 1st and the last points are displayed. Set it to true to remove them

enter image description here

| improve this answer | |

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.