Bug report #19998

Cannot export output of 'Points along geometry' tool as Geopackage

Added by James Duffy over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/OGR
Affected QGIS version:3.5(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27820

Description

I have a polygon layer which I use as an input to the 'Points along geometry tool'. I produce a temporary layer which contains my points.

Then I go to export this temporary layer as a GeoPackage and get the following error.

Export to vector file failed.
Error: Feature write errors:
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: temp.fid)
Only 1 of 24 features written.

It might be because the temporary layer has the same value (1) for every feature in the FID field.


Related issues

Related to QGIS Application - Bug report #19758: Processing: merge vector layers produces duplicated fid Open 2018-09-03
Related to QGIS Application - Bug report #19708: Processing: Join attributes by location produces duplicat... Closed 2018-08-27
Related to QGIS Application - Bug report #20291: Cannot export layer with a field "fid" which is not uniqu... Open 2018-10-31

Associated revisions

Revision d0eeffbe
Added by Matthias Kuhn over 1 year ago

Regenerate fids for "points along geometry"

Fix #19998

Revision d7b01dba
Added by Matthias Kuhn over 1 year ago

Regenerate fids for "points along geometry"

Fix #19998

History

#1 Updated by Andrea Giudiceandrea over 1 year ago

I think it is related to #19708 and #19758

#2 Updated by Giovanni Manghi over 1 year ago

  • Related to Bug report #19758: Processing: merge vector layers produces duplicated fid added

#3 Updated by Jérôme Guélat over 1 year ago

Yes, it is definitely related... The easiest solution is to delete the fid column in the temporary layer and then save as a GeoPackage. This will recreate a new fid column respecting the UNIQUE constraint.

#4 Updated by Andrea Giudiceandrea over 1 year ago

  • Related to Bug report #19708: Processing: Join attributes by location produces duplicated fid added

#5 Updated by Matthias Kuhn over 1 year ago

I think it's better to split this bug report into two separate ones:

1. Rename this one to 'Cannot points along geometry creates duplicate fid' and fix direct export to geopackage
2. Create a new one 'Cannot export layers with a field fid with duplicate ids to GeoPackage'

#6 Updated by Matthias Kuhn over 1 year ago

  • Subject changed from Cannot export temporary layer outputted by 'Points along geometry' tool as Geopackage to Cannot export output of 'Points along geometry' tool as Geopackage
  • Affected QGIS version changed from 3.2.2 to 3.5(master)

#7 Updated by Matthias Kuhn over 1 year ago

  • Status changed from Open to In Progress

#8 Updated by Jürgen Fischer over 1 year ago

  • Related to Bug report #20291: Cannot export layer with a field "fid" which is not unique to GeoPackage added

#9 Updated by Anonymous over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

Also available in: Atom PDF