5

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 '19 at 14:33
  • nothing returned with the simple select or with select ST_AsText(geom) – jlSta Feb 27 '19 at 15:52
  • I added the gpkg file – jlSta Feb 27 '19 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 M Apr 23 '19 at 18:42
3
+25

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, privacy policy and cookie policy

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