<div dir="ltr">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!<div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Luigi Pirelli<br><br>**************************************************************************************************<br>* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" target="_blank">https://www.linkedin.com/in/luigipirelli</a><br>* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" target="_blank">http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>* GitHub: <a href="https://github.com/luipir" target="_blank">https://github.com/luipir</a><br>* Mastering QGIS 2nd Edition:<br>* <a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" target="_blank">https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition</a><br>* Hire me: <a href="http://goo.gl/BYRQKg" target="_blank">http://goo.gl/BYRQKg</a><br>**************************************************************************************************</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 13 Sep 2018 at 11:45, Bo Victor Thomsen <<a href="mailto:bo.victor.thomsen@gmail.com">bo.victor.thomsen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Lene -<div><br></div><div>I've made a few observations regarding the use of GeoPackage in DBManager...</div><div><br></div><div>I have a <i>GeoPackage</i> 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</div><div><br></div><div>If I use the <i>DBManager</i> with the <i>GeoPackage </i>dataprovider and execute the following statement: <b>select fid, st_area (geom) from renhold , </b>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.</div><div><br></div><div>An now the mystery!! :</div><div><br></div><div>If I use the <i>DBManager</i> with the <i>Virtual Layers -> Project layers </i>dataprovider and execute the following statement: <b>select fid, st_area (geometry) from renhold , </b>it returns a table with 2 columns as expected. And column nr. 2 do contain the expected area values. Go figure...<br></div><div><br></div><div>NB! The "renhold" layer is visible in the map and named "renhold" </div><div>NBB! In the <i>Virtual Layers</i> dataprovider you have to use the standard name "geometry" to represent the geometry column - not the real column name ("geom" in this case)</div><div><br></div><div>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 !</div><div><br></div><div><br></div><div>Regards </div><div>Bo Victor Thomsen</div><div>LIFA Denamrk</div><br><div class="gmail_quote"><div dir="ltr">Den tor. 13. sep. 2018 kl. 09.27 skrev Alexandre Neto <<a href="mailto:senhor.neto@gmail.com" target="_blank">senhor.neto@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Lee, <div><br></div><div>Can you try removing the quotation marks around geom? </div><div><br></div><div>Best wishes, </div><div><br></div><div>Alex Neto<br><br><div class="gmail_quote"><div dir="ltr">A qui, 13/09/2018, 02:04, Lene Fischer <<a href="mailto:lfi@ign.ku.dk" target="_blank">lfi@ign.ku.dk</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<div style="direction:ltr;font-family:Arial;color:rgb(0,0,0);font-size:10pt">
<div>Hi,</div>
<div>Trying out a geopackage layer in DBManager asking a simple SQL statement st_area</div>
<div>But when I try to write a statement like this<br>
</div>
<div><br>
</div>
<div>SELECT "vandopland".* , st_area("vandopland"."geom") as areal_m2<br>
FROM "vandopland"</div>
<div><br>
</div>
<div> "geom" is not found. Suggestions as geomfromexifgpsblob or geomfromfgf or geomfromwkb . Then I get "an error occured"</div>
<div><br>
</div>
<div>Any suggestions what I might have done wrong.</div>
<div><br>
</div>
<div>Regards from a newbee Geopagkace/DBmanager</div>
<div><br>
</div>
<div>Lene Fischer<br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div></div>-- <br><div dir="ltr" class="m_-4558189838979058420gmail-m_-1459157742685822879gmail_signature"><div dir="ltr"><div>Alexandre Neto</div><div>---------------------</div><div>@AlexNetoGeo</div><div><a href="http://sigsemgrilhetas.wordpress.com" target="_blank">http://sigsemgrilhetas.wordpress.com</a></div><a href="http://gisunchained.wordpress.com" target="_blank">http://gisunchained.wordpress.com</a><br></div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-4558189838979058420gmail_signature">Med venlig hilsen<div><br></div><div>Bo Victor Thomsen</div><div><br></div></div></div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div>