-
-
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
Wrong identification of feature in a View #26804
Comments
Author Name: Hugo Mercier (@mhugo) Can you provide your test data / project ?
|
Author Name: matteo ghetta (@ghtmtt) hi guys, of course! In attach a geopackage with a single layer. I created the view within the DB manager (a view that actually is just an exact copy of the source layer), as:
then registered the view in the gpkg_content table:
Finally registered also the geometric information in the gpkg_geometry_columns table:
Am I doing something wrong with the view creation? Thanks guys
|
Author Name: Hugo Mercier (@mhugo)
|
Author Name: Giovanni Manghi (@gioman)
Side comment: this is really what a user must do to see a (spatial) view show up in its GPKG datasource in QGIS?! By the way, I just tried to register the view/spatial information as described by Matteo and was greeted with this (not really clear) message: @sqlite objects created in a thread can only be used in that same thread. The object was created in thread id 140167101355776 and this is thread id 140167109748480.@ |
Author Name: Harrissou Santanna (@DelazJ)
Agreed! If these steps are required then it would make gpkg use only for an elite and hard to replace shp. |
Author Name: matteo ghetta (@ghtmtt) yes, fully agreed. This improvement could be another step towards the using geopackages instead of shapefile |
Author Name: Hugo Mercier (@mhugo) Thanks. It is the same problem as with virtual layers and spatialite layers. When no primary key is defined, an id is returned that is not the same when querying the whole layer or when querying only a subset (with a rectangle or by id). According to OGR documentation, you can manually specify which column will serve as a primary key for your view by naming it "OGC_FID". https://www.gdal.org/drv_geopackage.html So for instance:
To fix this in the general case, we should apply a fix similar to the ones for virtual layers (#8323) and spatialite layers (#8327) : do not use SQL filters if we do not have a primary key defined. I'll see what is possible with the OGR provider. |
Author Name: Jürgen Fischer (@jef-n) Bulk closing 82 tickets in feedback state for more than 90 days affecting an old version. Feel free to reopen if it still applies to a current version and you have more information that clarify the issue.
|
Author Name: matteo ghetta (@ghtmtt) issue is still valid. I don't know what could be the easiest fix, but maybe having the
|
Author Name: Giovanni Manghi (@gioman) matteo ghetta wrote:
on what version?
|
Author Name: matteo ghetta (@ghtmtt) last master 3.7
|
Author Name: Giovanni Manghi (@gioman)
|
guys, are there any WIP for making Views use more comfortable into a gpkg? I really really think that using a real database with such a complexity to create views is not user friendly. |
@ghtmtt I can't agree more... In DB manager we can run an arbitrary query on a Spatialite datasource and then with the "create view" button easily store it. With GPKGs that button is not there. Moreover, GPKGs views do NOT show in DB manager***, not even after the steps you describe in #26804 (comment) (with or without the tip from Hugo here #26804 (comment)). I am very interested in understanding how much work would be needed to make GPKGs fully supported in DB Manager, and eventually do my share to support such effort. *** Also GPKG rasters do not show in DB Manager see: #30932 |
thanks @gioman for the feedback. IMHO having a real db as default (or at least suggested) file format like gpkg without having a nice method to add views is not use friendly. Moreover: I just checked after you mentioned that also with spatialite there is the |
@ghtmtt this is my observation:
this happens because when saving the shape to SL QGIS calls the geom column "GEOMETRY" and not "geometry". The view is created anyway, but is not spatial.
then when clicking on "create view" there are no errors a the spatial view is correctly listed in DB Manager/Browser and added to the project. |
In my opinion, when we use the DBManager to create VIEWS or TABLES into a GPKG, a "system help" (more friendly) should registering "on the fly" the new objects... |
sure, the whole discussion above is about suggesting exactly it. |
@ghtmtt the original issue seems fixed on 3.24.0 having to do those manual steps to register a GPKG view is an horrible thing for final users, but I guess is a separate issue.
|
@gioman issue solved, confirmed!
definitely! IMHO having the nice button as we have for SpatiaLite would be a great improvement for Geopackage. |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
@gioman should this issue converted into a feature request? |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
ping @gioman just to know what to effectively do with this issue. Thanks! |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. |
Author Name: matteo ghetta (@ghtmtt)
Original Redmine Issue: 18973
Affected QGIS version: 3.7(master)
Redmine category:data_provider
I have created a very simple view in a geopackage layer. Trying to use the selection tool AND the identify tool results in a wrong feature identification.
With the selection tool wrong features are selected while with the identify tool the form of the same feature is opened again and again.
A small video in attach to better see the error.
BTW: the original layer (from where the view comes from) works perfectly, so it really seems a view related problem
Related issue(s): #23523 (relates)
Redmine related issue(s): 15600
The text was updated successfully, but these errors were encountered: