1

I am using QGIS Bonn 3.2.3.

I've recently been using the Difference function to calculate a list of points and it is taking a terribly long time. I was wondering if you could point out any obvious mistakes or better ways of solving my problem.

My end goal is to create a list of properties in Scotland that are likely to have a poor internet connection. I do it by considering two sets of points: Properties and Cabinets. There are about 3.5mln properties and 20k cabinets. The data sources are a .csv text file

Then I draw a 1km buffer around the cabinets and run there difference function to find the properties which are more than 1km away from cabinets.

Sounds pretty simple and everything works except that the calculation took 25 hours to finish and QGIS wasn't even using 10% of my computer's resources. And I am finding myself having to repeat a similar calculation for telephone exchanges and cabinets as well as for different distances in other UK countries. Current overall computation time estimate is over a week. And that's assuming I get it right the first time

My question: Is there a way of making QGIS use more of my computer's resources to finish the calculation faster or is there some other functionality I might use? Please share some other tips and tricks that could help me out.

At the moment, I feel like QGIS isn't the right tool for my task. I am considering writing a python script to compute this problem but (if possible) I would much rather have it run in QGIS.

1 Answer 1

3

I think you are doing too much work and have an unoptimised data source.

First what you actually want to use is a spatial select (Select by Location in the Vector research tools menu.

enter image description here

Simply select features from your point layer that are disjoint (not in or touching) the polygons of your buffer layer. Once you have a selection you can either save it using Export->Save Selected features or carry out a further analysis on the selection directly.

Things will go even faster if you store your data in a way that it has a spatial index, almost anything except a csv file in fact.

7
  • Thank you for your reply. You're 100% sure that anything other than a .csv better? I tried converting the points to a shapefile and that made it even slower. Oct 2, 2018 at 13:27
  • Follow up question: I have done as you advised and used the 'select by location' tool but I can't figure out where it is saving its output to. Oct 2, 2018 at 13:38
  • it isn't saved until you right click on the point layer and select export selected features.
    – Ian Turton
    Oct 2, 2018 at 13:38
  • After I run the operation, it does not appear in my 'Layers' window. Bizzarly it displayed the results on the map but it isn't listed in the Layers list. I am going to have another look. Oct 2, 2018 at 13:43
  • 1
    You're my hero <3 Oct 2, 2018 at 13:54

Your Answer

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

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