1

What I want to do is trim the shapefile so that only those records and associated shapes that match the same values in a column in the delimited text layer (which in my case is a CSV) are kept in a new shapefile file.

0

Asuming that you have a polygon vector layer named "polygons", with a column named "name".
Assuming also that you have a delimited text layer named "csv", also with a column named "name".

You can Create a Virtual Layer, with the rows of the "polygons" layer that have the same value in the "name" column as any row (in the "name" column too) of the "csv" layer, with the following query:

SELECT DISTINCT 
  p.* 
FROM 
  polygons AS p 
  INER JOIN
    csv AS c 
    ON
      p.name = c.name

Then, you can export the virtual layer to a shapefile.

Replace polygons, csv and name with the name of your layers and common field. Note that the data type must be the same for both columns.

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.