[Qgis-user] Geopagkage and "geom" in DBmanager

Luigi Pirelli luipir at gmail.com
Thu Sep 13 03:42:44 PDT 2018


I dont' know in deep the detail of virtual layers, as far as I remember a
virtual layer have a spatialite support of the virtualised layer. e.g. has
all spatial operators. Geopackage, per definition ,if no spatialite
extension has been loaded, is a simple container e.g. does not have any
spatial operator => this should explain the mistery!

Luigi Pirelli

**************************************************************************************************
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
*
https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
* Hire me: http://goo.gl/BYRQKg
**************************************************************************************************


On Thu, 13 Sep 2018 at 11:45, Bo Victor Thomsen <bo.victor.thomsen at gmail.com>
wrote:

> Hi Lene -
>
> I've made a few observations regarding the use of GeoPackage in
> DBManager...
>
> I have a *GeoPackage* based table called "renhold" containing polygons.
> Primary key column is an integer called "fid" and the geometry column is
> called "geom" - It's pretty close to your setup
>
> If I use the *DBManager* with the *GeoPackage *dataprovider and execute
> the following statement: *select fid, st_area (geom) from renhold , *it
> returns a table with 2 columns as expected. However , column nr. 2 contains
> only nulls. However, the statement does not result in an error. The
> function "st_area" simply doesn't return a value besides null.
>
> An now the mystery!! :
>
> If I use the *DBManager* with the *Virtual Layers -> Project layers *dataprovider
> and execute the following statement: *select fid, st_area (geometry) from
> renhold , *it returns a table with 2 columns as expected. And column nr.
> 2 do contain the expected area values. Go figure...
>
> NB! The "renhold" layer is visible in the map and named "renhold"
> NBB! In the *Virtual Layers* dataprovider you have to use the standard
> name "geometry" to represent the geometry column - not the real column name
> ("geom" in this case)
>
> Actually I have a reasonable explanation: The 2 different dataproviders
> uses different internal functions to calculate the area. However the
> function used by the GeoPackage Dataprovider doesn't work !
>
>
> Regards
> Bo Victor Thomsen
> LIFA Denamrk
>
> Den tor. 13. sep. 2018 kl. 09.27 skrev Alexandre Neto <
> senhor.neto at gmail.com>:
>
>> Hi Lee,
>>
>> Can you try removing the quotation marks around geom?
>>
>> Best wishes,
>>
>> Alex Neto
>>
>> A qui, 13/09/2018, 02:04, Lene Fischer <lfi at ign.ku.dk> escreveu:
>>
>>> Hi,
>>> Trying out a geopackage layer in DBManager asking a simple SQL statement
>>> st_area
>>> But when I try to write a statement like this
>>>
>>> SELECT "vandopland".* , st_area("vandopland"."geom") as areal_m2
>>> FROM "vandopland"
>>>
>>>  "geom" is not found. Suggestions as geomfromexifgpsblob or geomfromfgf
>>> or geomfromwkb . Then I get "an error occured"
>>>
>>> Any suggestions what I might have done wrong.
>>>
>>> Regards from a newbee Geopagkace/DBmanager
>>>
>>> Lene Fischer
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>> --
>> Alexandre Neto
>> ---------------------
>> @AlexNetoGeo
>> http://sigsemgrilhetas.wordpress.com
>> http://gisunchained.wordpress.com
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> --
> Med venlig hilsen
>
> Bo Victor Thomsen
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180913/9cd84383/attachment.html>


More information about the Qgis-user mailing list