42

I'm using QGIS 1.8 with a PostGIS database and I have three PostGIS-layers in QGIS a lines layer, a points layer and a polygon layer.

What I'm trying to do is to select a polygon in the polygon layer and mark all points within this polygon.

For me the only way to do this is to use the button "Select by Polygon" but in this way, I cannot use an existing polygon for selection.

54

Two possible solutions:

  • You can use the "Vector->Research tools->Select by Location" and tick the "Use selected features only" checkbox.
  • If you want to actually export the points which intersect your selected polygon to a new shapefile then "Vector->Geopressing tools->Intersect" and again tick the "Use only selected features" checkbox. The input layer will be your points layer, and the select layer will be your polygon layer.
  • Furthermore, am I correct in adding that for the Vector processing to work, the following two conditions need to be met: [1.] The layers need to have the same CRS; and [2.] The layer needs to be selected in the 'Layers' panel. – Gonja Apr 5 '16 at 14:26
  • 1
    I do not have "Use only selected features" checkbox, see dropbox.com/s/hw2d422gh6wmoxm/… ? I have 2 layers, selected, and an object selected in one of the layers. – JaakL Apr 18 '17 at 8:43
  • 2
    Take care when the layers are too large - they must be loaded into QGIS as a whole, which may be slow. It may be better to use a PostGIS query (e. g. via the DB Manager) instead. – Jan Šimbera Jan 22 '18 at 8:49
  • @JaakL I had the same problem, but as you can see in the response below, the default behavior is to use the selected features if any: gis.stackexchange.com/a/257060/121285 – nanocv Sep 17 '18 at 11:19
  • The intersect tool works so-so in edge/boundary conditions, I would suggest trying the Select Within plugin suggested below – Justin Kray Nov 10 '18 at 3:07
2

I can suggest using a QGIS Plugin namely Select Within.

  • Yes!!! Tried this tool once & it nailed it. Select by centroid is the behavior I would expect from the default QGIS Select by Location tool, which did not perform very well on edge and boundary conditions. – Justin Kray Nov 10 '18 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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