2

I want to edit a layer by "ShapeLib C library" and "QGIS" at the same time. It means there is two reader/writer on one file (blah1.shx , blah1.dbf , blah1.shp).

I added a layer (etc: "point1.shp") to QGIS project , then add a point to this layer by ShapeLib simultaneously. Finally I see this point is added in QGIS.

When I add a point in QGIS, after save it, previous point (which added by Shapelib) will be removed unexpectedly!

How can I solve this problem?

  • 3
    You need to add some kind of locking. However since QGIS doesn't really have any support for that with Shapefiles, you'll need to do this procedurally (i.e. don't add at the same time). If you want to do multi-writer, you'll need something that supports it, like a database. Most people suggest PostGIS. – BradHards Oct 19 '16 at 7:21
1

No you can't edit your shapefile with multiple processes (or users). You are likely to corrupt the data.

Esri states:

Keep in mind that a shapefile supports only one person editing it at a time, although multiple users can view it simultaneously. Attempting multiuser editing of a shapefile can result in data corruption.

  • Thanks, Do you have any suggestion except PostGIS? – HEXER Oct 19 '16 at 10:32
  • I don't know of anything apart from PostGIS (or other spatial database) – user2856 Oct 19 '16 at 10:56

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.