Geographic Information Systems Asked by Adylene Bueno Aguilar on July 27, 2021
I am pretty new with QGIS and GIS in general.
The thing is I have 2 shapefiles, the first one with municipalities (2457 polygons) and the second one with hydrological regions (363 polygons). I need to know which municipalities are inside which hydrological region. The shp with the hydrological regions has a column with an ID
(HR1
, HR2
, etc.).
How can I add that value to each municipality?
You can use Vector general > Join Attributes by Location
tool in Processing Toolbox(Ctrl+Alt+T
).
Input layer
to municipality layerJoin layer
to hydrological regions layerwithin
onlyID
field in Multiple selection
windowJoin type
to Take attributes of the first matching feature only (one-to-one)
and run the toolCorrect answer by Kadir Şahbaz on July 27, 2021
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.
Answered by JULESG on July 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP