8

I'm using QGIS 3.16 Hannover under MacOS 10.13 environment. I've got two polygon shapefile layers: 'LIC' and 'ZEPA'. Some polygons (name, code & geometry) are present in both layers and I want to identify them by adding a new field to the layer 'ZEPA' with the value "yes" if that feature is also present in the other layer. I've tried in the field calculator the function overlay_equals(). My try has been

    array_to_string(overlay_equals('LIC', "yes"))

But it returns the new field empty (instead of "yes") for those equal features. What is wrong?

2
  • Did you also try 'yes'? Commented Feb 28, 2021 at 15:55
  • I did, but it returns NULL for all features.
    – jpinilla
    Commented Feb 28, 2021 at 15:57

1 Answer 1

7

The following code actually does what I want:

CASE
    WHEN overlay_equals('LIC') = 1 THEN 'yes'
    ELSE NULL
END

Another option could be obtaining a 0/1 return, setting an integer field with the following expression:

overlay_equals('LIC')

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.