TransWikia.com

Merging multiple shapefiles and finding which shapefile gives the minimum value for each attribute in QGIS?

Geographic Information Systems Asked by H. Cahill on April 30, 2021

I have several different shapefiles that I want to combine into one based on the minimum value of each attribute. I found this solution. However, I also want to know which shapefile each minimum value came from.

For example, I have 5 shapefiles with values in each one of 10 attributes. For each attribute, I found the minimum value from one of the 5 shapefiles using the method in the solution above. But I also want to know which of the 5 shapefiles the minimum value came from for each attribute. Is this possible?

One Answer

I found the answer to my question here.

I use "select" to choose which columns (in this case, "layer") I want to keep:

select layer, min(id), "geometry" from Merged group by attribute

Here, "layer" is a column in my Attribute Table with information about which shapefile each "id" came from.

Correct answer by H. Cahill on April 30, 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