I am looking to move a mess of shapefiles to a newer format, either Spatialite or Geopackage.

I have read that Spatialite can handle multiple users editing the same file more or less simultaneously. Is the same true for Geopackage?

Does one handle this sort of thing more easily than the other?

  • As far as I know, the formats are quite similar, and neither is intended for multiuser editing. – Micha Aug 28 '18 at 21:52
  • 2
    Possible duplicate of gis.stackexchange.com/questions/67919/… – nmtoken Aug 29 '18 at 5:52
  • 1
    GeoPackage based on SQlite which support multithreaded editing/reading. But it depends on library which implements GeoPackage functionality. For example GDAL open it in single mode (no multithreaded) per instance (2 different instances of GDAL, i.e. two simultaneous ogr2ogr, theoretically can edit the one GeoPackage). – Dmitry Baryshnikov Aug 29 '18 at 7:42
  • Not a full answer - but I just corrupted my Geopackage db by having it open in QGIS and Spatialite GUI as the same time. Switching to SQLite for now, but I suspect I'll get the same problem eventually. – dsz Jan 10 '19 at 0:17
  • @dsz, how did the corruption happen? What were the consequences? – user30184 Jun 28 '19 at 13:10

This is an old question, but it showed up repeatedly in the search results, so I thought it may be relevant to share some info regarding it.

I have no technical background on how Geopackage works internally, so after searching for information on the simultaneous editing capabilities of Geopackage and barely finding anything conclusive, I decided to try it myself. I loaded the same Geopackage layers in two different Qgis (3.8.2) projects, and this is what I found out.

  • If the layer you want to edit is stored in a Geopackage file/database with other layers, concurrent editing on one of those layers doesn't seem to work: both users will get a database error when trying to save.
  • However, if the layer you want to edit is on a separate Geopackage file with no other layer, both users will be able to see and edit it at the same time.

This is the (apparent) behaviour in that second case:

  • If one user adds features to the layer and saves it, the other user will instantly see the new features in his loaded version of the layer, WITHOUT LOSING his/her own unsaved changes. It will also work in the opposite direction.
  • If one user DELETES one feature while the other is EDITING it, the deletion "wins". The edition is not propagated even if you save the layer. Deletion, however, does get propagated when the deleting user saves the layer.
  • If both users try to edit the same shape, the first one to save will propagate the changes to the other, but the other will still see the outline he/she was editing on top of the updated shape (see image below), and will be able to overwrite it on save. I don't know if that's a feature or just a (quite useful) bug.

Editing shape overlapped to updated shape

In conclusion, I wouldn't trust a Geopackage layer for all kinds of concurrent editing. But if both users are just adding objects or being sure they won't be editing the same ones, it seems to work very well, like almost real-time collaboration.

  • I dont understand, how the same layer could be in two different geopackage ? – J.R Sep 18 '19 at 21:28
  • 1
    Uh, maybe I didn't explain it properly. I mean that concurrent editing only seems to work if you are using one Geopackage file per layer, or one single layer in each Geopackage file... instead of a single Geopackage with several layers (including the one you are editing) inside. Edit: I just edited the answer. – Jorge Toledo Sep 21 '19 at 17:03

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.