Skip to main content

Hello dear Community,

Despite having a Sorter, DulicateFilter and Tester right out of the gate in my model, I still seem to be experiencing this issue on the ID field of my model -

 

OGCGEOPACKAGE writer: failed to execute insert : UNIQUE constraint failed

 

If I run it one at a time, it seems to work, but I'm trying to write to make different Geopackages, with 4 tables in each (with spatial data).

 

I've been racking my brain about this for some time, changing writers from manual to automatic, deleting any output data after each test run to ensure it's not conflicting, making sure there's no duplicates in the ID field that would trip up the writers, but to no avail - and wondered if anyone here may have a lifeline to throw me.

Thank you

It is possible that the GeometryValidator is the culprit, if there are errors that lead to decomposed/split geometries.

Try moving the DuplicateFilters after the GeometryValidator.


Hi David, still no luck with this setup unfortunately


Hi Joe,

I have a similar issue. (How) were you able to solve it?


Hi Joe and others looking for this problem,

 

I think I found the solution. By default, the Primary Index Column is 'id'. If your data contains an attribute id, it gets mixed up. Creating an attribute id_gpkg for example bypasses the problem. I hope this helps.

 

id_gpkg  

 


Hi Joe and others looking for this problem,

 

I think I found the solution. By default, the Primary Index Column is 'id'. If your data contains an attribute id, it gets mixed up. Creating an attribute id_gpkg for example bypasses the problem. I hope this helps.

 

id_gpkg  

 

Hi Jelle, thank for this solution. I also ran into this problem. Apparently id is not allowed as an attribute name.


It is possible that the GeometryValidator is the culprit, if there are errors that lead to decomposed/split geometries.

Try moving the DuplicateFilters after the GeometryValidator.

For me this worked, I used a deaggregator (flattened at all levels) → Geometry Extractor → DuplicateFilter to remove all the duplicate geometries. 


Reply