TransWikia.com

QGIS: Unable to save changes after merging features

Geographic Information Systems Asked on July 10, 2021

I have a Spatialite layer with two features, the result of a QuickOSM search. I’d like to merge them into a single feature. Before editing, the layer looks like this:

enter image description here

I can enable editing for the layer, select the features, and use the "Merge Selected Features" tool to merge them, which apparently does the right thing, and results in:

enter image description here

Which is exactly what I want. But when I attempt to save the changes, I get this error:

Could not commit changes to layer name_Camp Greenough

Errors: ERROR: 2 feature(s) not deleted.
  
  Provider errors:
      OGR error deleting feature 1: sqlite3_exec(DELETE FROM 'camp_greenough' WHERE "ogc_fid" = 1) failed: no such table: main.idx_camp_greenough_GEOMETRY
      OGR error deleting feature 2: sqlite3_exec(DELETE FROM 'camp_greenough' WHERE "ogc_fid" = 2) failed: no such table: main.idx_camp_greenough_GEOMETRY

Inspecting the layer file with sqlite3, there is indeed a table named camp_greenough that has a GEOMETRY column. There is no idx_camp_greenough_GEOMETRY index. Why is QGIS expecting one?

One Answer

While I hope that someone comes along with an explanation about what was going on, I was able to work around the problem by exporting the layers as a geopackage and adding that instead. With that change I was able both to merge features and save the changes.

Answered by larsks on July 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP