In DB Manager in QGIS 2.18.26

I want to select geometries in geopackage table. The returned geometry column is null but the source layer can be loaded as a geometry table in Qgis and i can read the geometry text.

Source Layer: Source layer with text geometry

Select on geometry column Select on geometry columns return NULL values enter image description here

How can i get the geometries?

EDIT: Here is the file

  • 1
    Use just select geom from deljin*_lines. Or select ST_AsText(geom)…if you want to see the WKT presentation of geometries.
    – user30184
    Commented Feb 27, 2019 at 14:33
  • nothing returned with the simple select or with select ST_AsText(geom)
    – jlSta
    Commented Feb 27, 2019 at 15:52
  • I added the gpkg file
    – jlSta
    Commented Feb 27, 2019 at 16:00
  • gis.stackexchange.com/a/224020/120129 Commented Apr 23, 2019 at 17:54
  • you have different names for the fields "id" and "fid", as well as "geom" and "geometry" ...select * from delijn_lines_za; select * from delijn_stops; select * from delijn_lines; Commented Apr 23, 2019 at 18:42

1 Answer 1


I also get empty values when I query the geopackage. (I tried both, QGIS 2.18.26 and 3.6) Perhaps it is a bug...

But, when you query the qgis-layers on the other hand, the query returns results.

  • In DB-manager go to virtual layers > QGIS layers

  • add following query:

    select AsText(geometry) as geom, * from "transports_en_commun delijn_lines"

You get a result.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.