I have 2 layers that intersect, called layer A and layer B.
Layer A has an attribute (X) that I want to copy wholesale (for the whole layer) to layer B, so that when object A1 intersects object B1, attribute X1 from A1 is copied to B1.
I am trying to do this in QGIS. I used to do this in Mapinfo with an UPDATE query… then I switched to Mac. I am new to QGIS.
Best Answer
You need to use
Join attributes by location
fromProcessing Toolbox -> QGIS geoalgorithms -> Vector General tools -> Join attributes by location
which allows you to copy the attribute of one of the two layers into the other using variousGeometric Predicates
includingintersects
andtouches
as you can see below:If you want to transfer all records, even if they is no spatial connection, you need to choose
Keep all records
, otherwise you need to chooseOnly keep matching records
located under Joined Table.