qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.62k stars 3.01k forks source link

Duplicate feature ID Geometry error #56737

Open tsmcgrath opened 8 months ago

tsmcgrath commented 8 months ago

I have a geopackage with feature ID errors. It repro's the easiest when you try to export it to an ESRI GDB and throws the errors listed below. It seems similar to #43118 and #25795 (fixed by #43118).

https://github.com/qgis/QGIS/pull/43118 https://github.com/qgis/QGIS/issues/25795

What is the bug or the crash?

Tried to save as ESRI GDB and get these errors. Which indicates FID duplicates, which is a problem for a unique index.

Export to vector file failed. Error: Feature write errors: Feature creation error (OGR error: Cannot create feature of ID 7617 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7617 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7617 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7620 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7620 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7757 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7757 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7782 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7781 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7781 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7781 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7781 because one already exists) Feature creation error (OGR error: Cannot create feature of ID 7781 because one already exists)

Steps to reproduce the issue

There is a dataset to repro the issue here. Just pull it into QGIS and try exporting to a GDB: https://github.com/tsmcgrath/catch23public/data/ESDCatch_v3-bugtest.gpkg

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.34.1-Prizren | QGIS code branch | Release 3.34 -- | -- | -- | -- Qt version | 5.15.8 Python version | 3.11.6 GDAL/OGR version | 3.8.0 PROJ version | 9.3.0 EPSG Registry database version | v10.094 (2023-08-08) GEOS version | 3.12.0-CAPI-1.18.0 SQLite version | 3.44.2 PDAL version | 2.6.0 PostgreSQL client version | unknown SpatiaLite version | 5.1.0 QWT version | 6.2.0 QScintilla2 version | 2.14.1 OS version | macOS 14.2   |   |   |   Active Python plugins FreehandRasterGeoreferencer | 0.8.3 ORStools | 1.7.1 batchvectorlayersaver | 0.9 batch_gps_importer | version 1.0.1 GpxSegmentImporter | 2.5 CZMLBillboardMaker | 0.8 osminfo | 0.8.1 quick_map_services | 0.19.34 IPyConsole | version 2.0 qgis2wegue | 1.1.1 splitmultipart | 1.0.0 LAStools | 2.0.1 OpenTripPlannerPlugin | 1.0.1 GeoCoding | 2.19 ImportPhotos | 3.0.5 qgis2web | 3.18.2 mask | 1.10.2 qfieldsync | v4.7.1 Beeline | 0.2.0 qgis_resource_sharing | 1.0.0 qgis-maptiler-plugin | 3.2 CSMapMaker | 0.5 processing | 2.12.99 grassprovider | 2.12.99 db_manager | 0.1.20 MetaSearch | 0.3.6 QGIS version 3.34.1-Prizren QGIS code branch [Release 3.34](https://github.com/qgis/QGIS/tree/release-3_34) Qt version 5.15.8 Python version 3.11.6 GDAL/OGR version 3.8.0 PROJ version 9.3.0 EPSG Registry database version v10.094 (2023-08-08) GEOS version 3.12.0-CAPI-1.18.0 SQLite version 3.44.2 PDAL version 2.6.0 PostgreSQL client version unknown SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version macOS 14.2 Active Python plugins FreehandRasterGeoreferencer 0.8.3 ORStools 1.7.1 batchvectorlayersaver 0.9 batch_gps_importer version 1.0.1 GpxSegmentImporter 2.5 CZMLBillboardMaker 0.8 osminfo 0.8.1 quick_map_services 0.19.34 IPyConsole version 2.0 qgis2wegue 1.1.1 splitmultipart 1.0.0 LAStools 2.0.1 OpenTripPlannerPlugin 1.0.1 GeoCoding 2.19 ImportPhotos 3.0.5 qgis2web 3.18.2 mask 1.10.2 qfieldsync v4.7.1 Beeline 0.2.0 qgis_resource_sharing 1.0.0 qgis-maptiler-plugin 3.2 CSMapMaker 0.5 processing 2.12.99 grassprovider 2.12.99 db_manager 0.1.20 MetaSearch 0.3.6 ### Supported QGIS version - [X] I'm running a supported QGIS version according to [the roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule). ### New profile - [X] I tried with a new [QGIS profile](https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles) ### Additional context This is an official ARM installation for a Mac M1. But this issue repro's on an Intel machine running 3.34 as well.
tsmcgrath commented 8 months ago

This problem exists on at least two datasets in a project. Not sure where the corrupted geopackage starts. The dataset provided to repro, and the other with the same issue, were generated by intersecting two polygon datasets together. But, I have not tracked down how far back in our workflow the problem goes.