Labels on QGis3 from the field calculator

by Rodrigo Ferraz   Last Updated October 10, 2019 00:22 AM - source

I have two features. One line feature and another polygon feature. I want the line feature label not to appear when it is within a polygon similar to the one in the figure. That is, I want the label to only appear when the line is outside the polygon. Is it possible to do this in Qgis3?

I tried the field calculator with the "within" function but it didn't work very well.

enter image description here

Below is the code I tried to do in the Qgis field calculator: CASE WHEN within( 'Lines_4e1a1089_ba02_495e_8c79_d32b79cf3b54','polygon_406a7fae_06b4_45a1_a20e_d64b8682e501') THEN " " ELSE THEN "Label" END

Tags : qgis-3 labeling

Related Questions

How to define leaders to a label in QGIS 2

Updated April 07, 2015 22:09 PM

How to manage label spacing/density in QGIS?

Updated May 04, 2015 21:09 PM

How to turn on/off all labels of all layers in QGIS

Updated January 30, 2017 14:09 PM