-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Browser adds layers to projects with a leading space #43129
Comments
Hi @Jeroen-GroeneBij, try with: |
Good find @agiudiceandrea. I did not put that leading space there. And now you mentioned it I see this all the time. Any gpkg I open gets this leading space in the layer name. That is hard to spot. And since I mainly use gpkg with a single vector layer, the vector layer often has the same name as the gpkg (default behaviour when saving as gpkg), so I was unaware of this when running db manager. I just recently started using the virtual layer option in db manager, so never ran into this before. Is it typical qgis behaviour to add a leading space. And why would that be so? |
No, I think it's an incorrect behaviour of the Browser. If you drag your GPKG file from Windows Explorer and drop it into the map or if you add the GPKG file using the Data Source Manager, then no leading space is added to the layer name. |
The possibility to drag GPKG files from the Browser to the map was added to QGIS 3.16 with PR #38792. Maybe there is something not correctly addressed in such new feature. |
Should I edit the title of this issue or open a new one? Because it is not actually a bug in db manager? |
I cannot reproduce on Linux/master. |
Can you check if the issue has been fixed in master? |
Here is a screencast: browser_gpkg_space.mp4The following additional odd error is reported adding the GeoPackage:
|
Errors are expected because we don't know if the GPKG contains any raster and we try to open with GDAL to see if there are any. This happens for all data sources that can contain rasters and vectors. |
Anyway, if you add a connection to the GeoPackage in the Browser panel, then you cannot add the GeoPackage from the GeoPackage tree node. browser_gpkg_error.mp4
|
Which is a different bug but I'll look into that one too. |
Using QGIS 3.16.4 on windows 10 I noticed DB manager not responding when working with a gpkg.
Use the following steps on the attached gem2015.gpkg as example
scenario 1
Save the gpgk in a folder
Use qgis browser panel to locate folder
drag gem2015.gpgk to the canvas
start db manager, go to virtual layers, click gem2015 (in project layer), open sql window
SELECT * FROM gem2015
No respons from db manager
scenario 2
close db manager
new qgis project
Use qgis browser panel to locate folder
left click click on gem2015.gpgk
drag vectorlayer gem2015 to canvas
start db manager, go to virtual layers, click gem2015 (in project layer), open sql window
SELECT * FROM gem2015
Everything is working fine.
The gpkg was created by saving a vectorlayer as gpgk. Same behaviour happend on a geojson layer saved as gpgk.
gem2015.zip
The text was updated successfully, but these errors were encountered: