[Qgis-user] geopackage spatial query

Mithoefer mithoefer at gbd-consult.de
Tue Oct 30 00:08:54 PDT 2018


Dear all,

thanks a lot for all your replies. They were all very helpful to me!


Am 29.10.18 um 20:47 schrieb Bo Victor Thomsen:
> Hi Klaus -
> 
> Even though the GeoPackage format is using a spatialite database as the 
> foundation, the internal format of the geopackage geometry type differs 
> from the spatialite type. So yon can't directly use spatialite geometry 
> based function with geopackage geometries.
> 
> However you can "wrap" every use of GeoPackage geometries in a converter 
> function: *CastAutomagic(geom)*, which converts a GeoPackage geometry to 
> a Spatialite geometry.
> 
> So a call to: /st_area (geom)/ becomes /st_area(*CastAutomagic(*geom*)*)/
> 
> (No, It's not nice and it certainly not effective use of computer 
> resources, however it works.)
> 
> There is a thread about the why's and why-not's for this subject in the 
> QGIS-user list around september 13 , 2018
> 
> Regards
> 
> Bo Victor Thomsen
> LIFA Landinspektører A/S,
> Denmark
> 
> 
> 
> 
> Den 29/10/2018 kl. 14.35 skrev Mithoefer:
>> Dear List,
>>
>> I have a geopackage database and tried to use a spatial sql function 
>> (st_area) using the db manager in qgis 3.4  --> select st_area(geom) 
>> from polygon_filename. The function is available, but the result is 
>> Null. What is the problem?
>>
>> Thanks a lot
>>
>> Kind regards
>>
>> Klaus
>> _______________________________________________
>> 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
> 
> 
> _______________________________________________
> 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
> 


More information about the Qgis-user mailing list