1

I am relatively new to QGIS and have been doing some simple georef and digitising work. At the start I lost a lot of data, as I hadn't saved properly, and I have been constantly saving ever since.

However, when I log into my project tonight all the data I created are gone.

enter image description here

The file size of the shapefile has now become very small (2kb) and everything has been deleted.

Does anyone know how I would get this back? I think I had around 40 digitised records.

2
  • I'm afraid you may need to have to fall back to your last backup.
    – Vince
    Commented Nov 15, 2022 at 0:28
  • To expend a bit on Babel answer note that all data format are not equal, in particular shapefile are composed of several different independent file (3 at minimum, QGIS create 5 by default at start and more could be created later...) you need all these file to stay together (in the same folder) and to have the same name to work properly (that is one of the reason shapefile are often not considered the best working data format...). So make sure you didn't move or delete the other file of your shapefile)
    – J.R
    Commented Nov 25, 2022 at 9:54

1 Answer 1

2

Basic concepts for saving project + data in (Q)GIS

Be sure to understand the basic concept of QGIS. There are at least three levels where you must save changes:

  1. The QGIS project. Imagine it like a specific compilation of certain, external data sources: the layers
  2. The layer. Imagine it like a container that can contain data. It is saved outside the QGIS project and separately from it. QGIS just links to the data source - be it a file (Shapefile, CSV, geoJSON, TIFF raster etc.), a file based database (e.g. Geopackage) or a server based database (like PostGIS).
  3. The features (records) of a layer/data source. Once you created (and saved) a layer, you can add data to it or change existing data - be it geometries or attribute information.

Imagine the last two steps like creating a new, empty Word processing file (the layer, step 2). Save it. Then start writing text (adding data): these changes (features) must be saved, as well (step 3).

Save changes in an existing layer

If you have a layer in QGIS, you must hit the pen icon (toggle editing mode) to be able to add new features (records). You must save these changes! Hit the save icon or leave editing mode by again clicking on toggle editing mode, then QGIS asks you if you want to save the changes.

Save layer (as such) permanently

Also be aware that your layer indeed is a permanent layer, saved on your disk or in a database. If you have a temporary scratch layer, changes are saved only in working memory and are only temporary as the icon next to the layer in the layer panels shows (see screenshot). To save it, right click on the layer and click either Make Permanent... (no changes possible, but fast) or Export > Save Features As... - with this last option you can make changes to the exported layer like reprojecting or selecting fields to exprot and their export options.

Save QGIS project

Also be aware of the fact that with the steps above, you saved the layer (data), but not the QGIS project. This has to be saved separately: Menu Project > Save.

enter image description here

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