8

When trying to save a large (281250 shapes), yet fairly simple shapefile (all shapes are rectangles with 5 attributes) from QGIS, it was still trying to save for over 2 to 3 hours before I killed it. I tried multiple times over a full day. The same shapefile saves in approximately 10 seconds from SAGA GIS. So I did most of my table editing in SAGA. However, the string editing capabilities in SAGA are a bit lacking, so I brought the file back over to QGIS. The edits to the strings using the Field Calculator were quick enough, but when I try and end the edit session and save the file, QGIS chokes really badly.

Am I doing something wrong, or does QGIS not handle shapefiles very well?

8
  • 1
    That is abnormal. I would try to save a copy with Save as... into different disk drives, perhaps that gives some info.
    – user30184
    Commented Sep 9, 2016 at 8:10
  • 1
    Where are you saving it? If it's on say a network drive, USB you may see slower performance depending on the connection speed
    – Liam G
    Commented Sep 9, 2016 at 20:42
  • 1
    Are you hitting the 2 GB limit for shapefiles?
    – AndreJ
    Commented Sep 10, 2016 at 5:26
  • 1
    Shapefile is 37.4 MB, dbf is 18.4 MB. So no, I am not hitting the 2 GB limit. Same results on network drive or local drive. The strange thing is that I can complete the same modification to the next to last column and save the file. Takes approx 10 minutes which is way longer than SAGA GIS, but at least it completes. However, when I complete the same modification to the last column, then the save process never completes. Is there something 'special' about the last column of a shapefile dbf and the way that QGIS handles them that is causing this problem?
    – Clay
    Commented Sep 10, 2016 at 22:23
  • 1
    Another thing, why when I delete a column does QGIS have to go through loading all 281250 features in the attribute table? This took well over 10 minutes to complete! Then when I go to save the file, QGIS has to reload all 281250 features in the attribute table again! Deleting this same column in SAGA GIS takes a second or less, then saving the results takes approx 10 seconds. If I delete two columns in QGIS, QGIS has to reload all 281250 features to the attribute table 2 times, before I even save!
    – Clay
    Commented Sep 10, 2016 at 23:21

2 Answers 2

5

Old question.... but I had same issue in QGIS 3 with almost one million points in a shape file. Saving as Geopackage instead solved the problem - saving took like 30 seconds.

3

"Another thing, why when I delete a column does QGIS have to go through loading all 281250 features in the attribute table? This took well over 10 minutes to complete! Then when I go to save the file, QGIS has to reload all 281250 features in the attribute table again!"

QGIS does not have to load any features to delete columns or save the file. There are a couple of methods which can avoid this (using the GUI):


  • Layer Properties > Fields

    You can toggle the editing of the shapefile (clicking the pencil icon), add/delete columns and access the field calculator:

    Field Properties

    Once edited, toggle the editing icon again and you will be prompted to either save or discard the edits.


  • Processing Toolbox > QGIS geoalgorithms > Vector table tools > Delete column

    Here you can access a tool which allows you to delete a column and save it as a temporary shapefile (so you can edit it further before writing it to disk) or save it immediately as a shapefile.


Although this is not a direct answer to your problem, both methods above allows you to avoid loading the attribute table which could save you some time.

Your Answer

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

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