4

I have a points geometry layer 'POINTS' with the field "ALTITUDE". And I have a polygon geometry layer 'POLYGONS' with the field "TERRITORY".

enter image description here

I would need a labeling expression to label the points layer but only the highest value within or nearest to the polygons layer. Like this handmade screenshot capture:

enter image description here

1 Answer 1

6

this can be done with the following expression for the label:

if ("ALTITUDE"=maximum(expression:="ALTITUDE", 
group_by:=overlay_intersects('POLYGONS',$geometry)),"ALTITUDE",'')  
1
  • 2
    I make a correction to your expression: if ("ALTITUDE"=maximum(expression:="ALTITUDE", group_by:=overlay_intersects('POLYGONS', "TERRITORY")), "ALTITUDE",'') I replace $geometry with "TERRITORY". Commented Jan 15 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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