Polygons inside polygons QGIS
You can use Vector general > Join Attributes by Location
tool in Processing Toolbox(Ctrl+Alt+T
).
- Set
Input layer
to municipality layer - Set
Join layer
to hydrological regions layer - Select
within
only - Select only
ID
field inMultiple selection
window - Set
Join type
toTake attributes of the first matching feature only (one-to-one)
and run the tool
You can use the tool join attributes by location
:
https://docs.qgis.org/3.10/en/docs/user_manual/processing_algs/qgis/vectorgeneral.html#join-attributes-by-location
He is located in the tab Vector
-> Data Management Tool
It allows you to choose 2 layers and the spatial relation to join attribute from one layer to the other (intersect, touches, within, etc...). You can also choose the column to join.
In the pictue layer_A
will be your municipalities, layer_B
your Hydrological Regions and the Geometric predicate
is within
. So every municipalities obtain the ID of the Hydrological Regions they are in.