I have feature polygons that sit within and across larger tenancy polygons, I need to transfer the tenancy reference from the tenancy polygons to the feature polygons. To do this I am using AutoFields Expression Builder to automatically fill in the feature polygons reference field as a new polygon is created.

My problem is I can either run the expression to return intersections or within, I can not work out how to do both at the same time. My current expressions are

geomintersects( 'NAT_CAP_Test_Tenancies',  'REFERENCE' )


geomwithin( 'NAT_CAP_Test_Tenancies',  'REFERENCE' )

is there a way to combine both?

1 Answer 1


Perhaps use an if conditional whereby if the feature is within another, the attributes are copied over otherwise it will check if the feature intersects another:

if(geomwithin( 'NAT_CAP_Test_Tenancies', 'REFERENCE' ) is not NULL,
geomwithin( 'NAT_CAP_Test_Tenancies', 'REFERENCE' ),
geomintersects( 'NAT_CAP_Test_Tenancies', 'REFERENCE' ))
  • @PDreyer - Most welcome, glad it helped :)
    – Joseph
    Dec 22, 2017 at 11:11

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.