TransWikia.com

Polygons inside polygons QGIS

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?

2 Answers

You can use Vector general > Join Attributes by Location tool in Processing Toolbox(Ctrl+Alt+T).

  1. Set Input layer to municipality layer
  2. Set Join layer to hydrological regions layer
  3. Select within only
  4. Select only ID field in Multiple selection window
  5. Set Join type to Take attributes of the first matching feature only (one-to-one) and run the tool

enter image description here

Correct 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.

tool

Answered by JULESG on July 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP