2

I have managed to do a lot of work regarding point data in the wrong projection, I forgot to change CRS from user 1000005 to BNG before I saved the layer as BNG so now it thinks it is in BNG only it is in the wrong location by a few meters.

I have managed to give each point which is the same, only in the wrong location, the same unique ID number and have the list of numbers (14,000+) saved as a text file with each ID being separated by a comma.

Is there a way i can use this list of ID's to select the relevant ID from the newly corrected point data set?

I have tried using select by attribute and expression but it does not like the comma separating the values and will only search for one value for me at a time.

I think if '' was added to each number and an OR operator was placed in between each of them this would work in 'select by attribute' but unfortunately I am not aware of how to do this.

I am using QGIS 2.18 on windows 10

  • One way would be to create a virtual layer. You can select values from your "correct" dataset using IN (%your numbers from the list%) operator . Let me know if this is what you are looking for and need further clarification. – Ruslan Jul 31 '18 at 17:02
1

If you import the list of "bad" records as a CSV, you could possibly setup a join from the original table to the bad records via the Join tab in its layer properties. You could then use the QGIS select tools to select records where the joined fields are non-null, i.e. those which are present in the "bad" record CSV only.

0

You can use CSVKIT at the command line to "Execute a SQL query directly on a CSV" into a new CSV file:

csvsql --query "select name from data where age > 30" data.csv > old.csv

From here: http://csvkit.readthedocs.io/en/latest/scripts/csvsql.html

And here: https://source.opennews.org/articles/eleven-awesome-things-you-can-do-csvkit/

If you're really going to have to do a lot of work with CSV's, including changing values, I would suggest loading it into a PostgreSQL database, and potentially using PostGIS to do more work with the spatial component.

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.