I have a Spatialite database with a table called spatialite_objects, with spatial and non-spatial data.

Another layer is an Oracle Spatial Layer (id, geom) with 2 table joins (based on 2 csv files) called oracle_objects.

I use the DB Manager to import this layer to my Spatialite database, successfully.

Now, I want to do this with a QGIS Plugin using Python.

I know to create tables and doing queries with the pyspatialite library (from pyspatialite import dbapi2 as db). I think about to query the Oracle layer and to fill up the Spatialite table.

Is this the same way the DB Manager does the import or are there more "direct" commands to import a layer from the Canvas directly to a Spatialite database?

1 Answer 1


I typically use ogr python module to import additional spatial tables into sqlite db. A web search on this topic should bring up some examples of how to do this. I'm sure there are other methods out there too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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