2

I have drawn over 5000 polygons on a new layer, which following a program crash today seem to all be gone. This is despite me saving regularly. I thought that because QGIS references other layer files, my saves would update those layer files with the information I had drawn. Following the crash the respective layer file is 100 bytes and seemingly empty.

If there is any way that I can find the lost information please let me know. I'm running 3.14 on Mac.

  • 2
    How did you save? The "Save Project" button, or the "Save Layer Edits" button? – user2856 Sep 30 at 9:59
  • 2
    Where is your data stored? Is it on a company server or local? – TeddyTedTed Sep 30 at 9:59
  • Save project - I'm new to this, I suppose 'save layer edits' is what I should have used? – G T Sep 30 at 10:03
  • The file is saved to a cloud - perhaps a backup of the layer exists, although I don't know if anything would exist when it wasn't 'saved' - although I did draw all those polygons and a working file must have been created somewhere although may have been lost with the crash? – G T Sep 30 at 10:12
  • Onedrive History (if used) has previous versions of file microsoft.com/en-us/microsoft-365/blog/2017/07/19/…. (Plan to have a local file access incase of no internet and a cloud based sync/backup) – Mapperz Sep 30 at 13:38
6

Sorry you've had this experience. Chances are not high you can recover your work, I'm afraid.

Oversimplifying a bit, QGIS Projects consist of descriptions of what layers/data are to be used, and how they are to be displayed. This is what is saved when you save the project.

Data for each layer is saved in that layer's own file, whatever that might be. When you go into Edit mode, edits are held in QGIS' memory and saved (committed) to the layer file only when you exit Edit mode, or Save layer edits (with the disk icon) explicitly. This has advantages - e.g. you can undo/redo, transaction groups are supported for databases, etc., but it does mean your edits are not "safe" until you save them.

If you exited QGIS normally without saving layer edits, you would be warned, but of course that did not happen in a crash.

For more information on saving, see https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/editing_geometry_attributes.html#saving-edited-layers

It is possible that an uncommitted edit buffer is stored as a temporary file somewhere, and that it could be accessed and somehow read and processed before a new invocation of QGIS (post-crash) cleans it up. I hope someone answers in that regard, but it will be a nonstandard operation if it does exist, and I don't recall any mention of it being stored anywhere else than "memory".

There used to be an autosaver plugin that I think saved layer edits at regular intervals, but I don't think it has been updated for QGIS 3 (and in other ways such an autosave function can be quite dangerous!). Nevertheless, it would be great if someone updated it, or even wrote a plug in that would warn you if e.g. you had edit mode on, and unsaved changes, for more than 1(?) hour or so.

Cold comfort for you, I'm afraid, just a reminder to all of us to not stay in edit mode with unsaved changes for longer than we're willing to lose. For me that's about 5 minutes; once I'm happy with a digitized feature, or small handful if they're simple points, I save the layer edits.

| improve this answer | |
  • Thank you very much - have resorted to paying a kind student to assist me - there's no way I could mentally and physically (my back couldn't handle it) redo the 5000 polygons. I'll be sure to save the layer edits at regular intervals from now on. This all reminds me that even the 'save' button functionality is not a given when working across programs that you're not that familiar with! – G T Sep 30 at 13:52

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.