4

I have a point shp and list of point IDs in CSV file which match with point IDs in the shape. Points in SHP have location while points in the external file don´t. How can I select points in the shp according to the external list of points? Simple question but not easy to find an answer in QGIS 2.18.

  • 1
    Load your point shapefile and your CSV file as a delimited text file (specify it has no geometry). Then right-click your point layer and go to Properties > Joins. Click the green plus button to add a join, select the CSV as the Join layer, select the "ID" fields for both Join and Target fields. Your point layer should now contain attributes from the CSV from which you can select your points. – Joseph Jan 18 '17 at 15:25
  • 1
    You already have comment by @Joseph, but may also find this tutorial helpful. QGIS tutorials and tips - Performing Table Joins – Kazuhito Jan 18 '17 at 15:28
  • 1
    @Joseph I couldn't get this to work if the list in the CSV file is simply a list of the point IDs that need to be selected, and not a list of all the point IDs with a second field indicating whether the point ID should be selected or not. I think the question was asking about the latter. Thoughts? – derNincompoop Jan 18 '17 at 15:40
  • 1
    @derNincompoop - If you have a list of point IDs you want selected, go to the attribute table for your point layer and find a joined field from the CSV which contains values. Click the name of the field so that it gets sorted into ascending/descending order. If a point ID from the CSV matches that with the point layer, you should see the values. Scroll down until there are NULL values, these are the points which do not exist in the CSV. You can then just select these from the attribute table or use the Select by Expression tool etc. – Joseph Jan 18 '17 at 15:49
  • 1
    @Joseph Got it - the join wasn't working for me until I selected the fields to join in the 'Choose which fields are joined' box (which looked to be optional to me). – derNincompoop Jan 18 '17 at 16:37

Your Answer

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

Browse other questions tagged or ask your own question.