[Qgis-developer] Accessing spatialite functions with qgis-internal spatialite

a.furieri at lqt.it a.furieri at lqt.it
Sat Apr 3 03:29:43 EDT 2010


On Fri, 2 Apr 2010 22:52:09 -0800, Gary Sherman wrote
> On Apr 2, 2010, at 14:53, Jürgen E. Fischer <jef at norbit.de> wrote:
> 
> > Hi Gary,
> >
> > On Fri, 02. Apr 2010 at 12:05:52 -0800, Gary Sherman wrote:
> >> The spatialite functions (e..g AddGeometryColumn) are reported as
> >> being non-existent when trying to create the new layer from C++.
> >
> >> Any thoughts on how to get access to the spatial functions using the
> >> qgis-internal spatialite?
> >
> > I quick'n'dirty added spatialite support to the new vector layer  
> > function.  [1]
> > is the patch. [2] is a clean spatialite template that should be put  
> > into
> > the resources directory in our tree.
> >
> > I tried both the system's and internal spatialite and didn't run  
> > into your
> > problem.  What did we do different?
> >
> My implementation is independent of the spatialite provider. Calling 
>  spatialite_init did the trick.
> 

All right, now it's all clear: any C or C++ module using SpatiaLite
on its own has to invoke spatialite_init() before attempting to
use spatial SQL functions.

Rationale: spatialite_init() actually registers the extended set
of SQL functions within the SQLite main core.
Until this step isn't performed the SQL data engine is completely
unaware of any 'extended' SQL function.

bye
Sandro


More information about the Qgis-developer mailing list