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 Feb 27 at 14:33
  • nothing returned with the simple select or with select ST_AsText(geom) – jlSta Feb 27 at 15:52
  • I added the gpkg file – jlSta Feb 27 at 16:00
  • 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; – Cyril Apr 23 at 18:42

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


I can't comment so I post this as an answer.

I downloaded your file and opened it in QGIS's DB Manager but I can see only the stops.

Could you please share it again making sure the lines are included? I'm trying to reproduce the error.enter image description here

  • I dowloaded my file, dragged and dropepd in qgis. It gives me the possibility to choose 3 layers :/ – jlSta Feb 28 at 7:19
  • Ok, never mind. What exactly are you trying to select? By which attribute? – user99006 Feb 28 at 14:54
  • i want to select the table. it returns all the attributes and the geometry column. But this geometry column is empty as showed on the last snapshot. – jlSta Feb 28 at 15:14
  • All the elements of the table? – user99006 Feb 28 at 19:14
  • or only the geom as you want but the geom column is always empty – jlSta Mar 4 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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