Skip to main content
Question

OGC Geopackage Writer and UNIQUE constraint failed


joe.fme
Contributor
Forum|alt.badge.img+4

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

6 replies

david_r
Celebrity
  • August 27, 2020

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.


joe.fme
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 28, 2020

Hi David, still no luck with this setup unfortunately


jelle
Contributor
Forum|alt.badge.img+16
  • Contributor
  • October 30, 2020

Hi Joe,

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


jelle
Contributor
Forum|alt.badge.img+16
  • Contributor
  • October 30, 2020

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  

 


arnovananrooij
Contributor
Forum|alt.badge.img+5
jelle wrote:

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.


kavyajeetbora
Participant
Forum|alt.badge.img+1
david_r wrote:

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. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings