-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative feature IDs, no updates possible #28218
Comments
Author Name: Jeffrey Bostoen (Jeffrey Bostoen) Actually tried a workaround with a GeoJSON file, but each time I edit it, it just creates another .tmp file and leaves the original file untouched ... |
This seems to be happening with geopackages on 3.4.2 as well. I imported OSM data to a geopackage. Some of the features were given a negative FID value. These negative values tend to be 'big' as well (e.g., -1984514722) even though there are only 319 features in this point layer. I can update an attribute value for any feature with a positive FID, but the edits don't persist when I edit a field on a feature that has a negative value. It appears that negative FIDs are also causing this problem with PostGIS layers served via WFS, as documented here. So it seems like this may be an issue with QGIS and not the data sources. |
yep, this seems to be the case for QGIS 3.12.2 |
$id gives negative ids too. Qgis 3.14.15, geopackage, windows 10. Have to execute the $id command a second time after closing attribute table to get positive ids. |
As far as I know, the negative IDs are "normal" as long as you haven't saved your features to file or DB. Then they are changed to DB generated IDs. Unless you are in transaction mode, where you get the DB generated ids immediately. But transaction mode is only available for selected DBs, like PostgreSQL, Oracle and perhaps (not sure) SQL-Server. |
Yes, this was the case in earlier versions, at least ive seen this behaviour before. But now, with geopackage and 3.14.15, the negative ids stay even after save, after closing and opening the att table. Whole steps where:
|
@dingausmwald can you attach sample data? thanks! |
I am having the same issue with version 3.22.10 |
I tried to figure out @Skipper-is 's solution inside QGIS, found DB Manager, could enter Am I missing a trick to edit the actual table from inside QGIS, or do I have to try to edit "kaesten.gpkg" with an external SQLite editor? |
(I did remove those rows with DB Browser for SQLite.) I have found ways to reproduce the error, i.e., produce rows with negative fids that then become unmodifiable and undeletable:
The same happens if I click with the 'Move Feature' Tool on a feature that I added but did not save yet. |
Author Name: Jeffrey Bostoen (Jeffrey Bostoen)
Original Redmine Issue: 20398
Affected QGIS version: 3.4.1
Redmine category:editing
I'm using data retrieved from a MySQL data source, using an x86 driver.
BIGINTs seem to internally be converted in some cases to negative values for ogc_fid.
Features get rendered, but it seems I'm unable to update any of the features with a negative ogc_fid
The text was updated successfully, but these errors were encountered: