I am currently using QGIS 2.18.15 and I have two sets of polygon layer data. I would like to use the Select by Location research tool in order to isolate the polygons that have their centers within the other separate layer. ArcMap has a specific "Have their centroid in" option when selecting by location. I don't see that QGIS has this. Is there an equivalent?
3 Answers
There is no direct equivalent in Qgis core, but you can use the "Select Within" plugin, which should do exactly what you need (it adds an entry in the vector menu):
Otherwise, you would need to extract the centroid as a new layer, then make the selection on it.
-
I've installed the plugin. Now where do I go to access it and use it?– NikiCommented Mar 17, 2018 at 20:25
-
-
Thanks. Found it. But, it didn't work. No features were selected. Any ideas?– NikiCommented Mar 17, 2018 at 20:32
-
By default, it uses "using selected features", which you need to disable to use the whole layer.– LeyanCommented Mar 17, 2018 at 20:37
For Select Within to work both layers have to be in the same CRS. They cannot simply be overlapping in the project window.
-
1Please report any bugs in the "Select Within" plugin to: github.com/HeikkiVesanto/SelectWithin/issues– HeikkiVesanto ♦Commented Apr 17, 2019 at 14:25
You can use multiple steps:
- Create centroids of the layer you want to select from
- Extract the centroids within the selection polygon layer
- Extract the polygons intersecting the extracted centroids: