5

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?

1
  • I don't know how the ArcMap tool handle this but the centroid of a polygon is not always inside the polygon (depending of the shape of the polygon). You should look at this point on any solution you come by to prevent unwanted result.
    – J.R
    Commented Apr 17, 2019 at 14:26

3 Answers 3

11

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):

Select Within plugin interface

Otherwise, you would need to extract the centroid as a new layer, then make the selection on it.

4
  • I've installed the plugin. Now where do I go to access it and use it?
    – Niki
    Commented Mar 17, 2018 at 20:25
  • It adds an entry in the vector menu.
    – Leyan
    Commented Mar 17, 2018 at 20:29
  • Thanks. Found it. But, it didn't work. No features were selected. Any ideas?
    – Niki
    Commented Mar 17, 2018 at 20:32
  • By default, it uses "using selected features", which you need to disable to use the whole layer.
    – Leyan
    Commented Mar 17, 2018 at 20:37
2

For Select Within to work both layers have to be in the same CRS. They cannot simply be overlapping in the project window.

1
2

You can use multiple steps:

  1. Create centroids of the layer you want to select from
  2. Extract the centroids within the selection polygon layer
  3. Extract the polygons intersecting the extracted centroids:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.