Bug report #20092
GeoPackage SQL issues in DB Manager
Status: | Open | ||
---|---|---|---|
Priority: | High | ||
Assignee: | - | ||
Category: | DB Manager | ||
Affected QGIS version: | 3.5(master) | Regression?: | Yes |
Operating System: | Windows 7 64bits, Linux | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 27914 |
Description
DB Manager issues with GPKG geometries on perfectly valid GeoPackage files (made by QGIS or ogr2ogr).
The following SQL queries fail in DB Manager
( but succeed in DB Browser 4 SQLite with EnableGpkgAmphibiousMode ) :
SELECT AsWKT(geom) FROM mypolygon;
--> returns NULL ; should return: MULTIPOLYGON(...
SELECT ST_Area(geom) FROM mypolygon;
--> returns NULL ; should return numeric
SELECT isvalid(geom) FROM mypolygon;
--> returns -1 (which means: UNKNOWN) ; should return 0 or 1
History
#1 Updated by Antoine Fonoxo about 6 years ago
Here is a clarification about DB Manager:
These queries fail in the "GeoPackage" section. But it works in the "Virtual Layers" section of DB Manager:
SELECT ST_Area(geometry) FROM mypolygon;
But you can't make an UPDATE or INSERT by "Virtual Layers"...
And I tested the same queries with ogrinfo (bundled with QGIS 2.18): no problem with geom functions.
#2 Updated by Alexandre Neto about 6 years ago
- Operating System changed from Windows 7 64bits to Windows 7 64bits, Linux
I am seeing this kind of problems also on QGIS 3.2.3 on linux.
In my case the layers were imported using Save as selected tool in QGIS. When I try to get something from the geom column it always return NULL. Still, I can still load the layer and visualize the layer fine on QGIS.
#3 Updated by Alexandre Neto almost 6 years ago
- Affected QGIS version changed from 2.18.24 to 3.4.1
- Priority changed from Normal to High
#4 Updated by Alexandre Neto almost 6 years ago
- Affected QGIS version changed from 3.4.1 to 3.5(master)
#5 Updated by Alexandre Neto almost 6 years ago
- Regression? changed from No to Yes