I have a shapefile with one layer. I can open it with QGIS. Now I want to convert this shapefile or layer to Spatialite database.

How can I do it? Is it possible to do with QGIS?

4 Answers 4


Several options!

  1. Within QGIS, you can "File|Save as" the shapefile directly as a spatialite database; the limitation here is that you can make a database with only one shapefile.

  2. You can use the command line spatialite_tool to load and manage shapefiles (tutorial here).

  3. It is really worth exploring the spatialite-gui and spatialite-gis standalone applications, which let you view and modify data directly. In the gui app, create a new database (second toolbar button), then load a shapefile (green world icon with arrow) - you must know and input the SRID of the shapefile in the resulting dialog. The advantage here is that you can easily add multiple shapefiles, and build a large database.


Yes it can be done with QGis.
Using the QSpatiaLite Plugin

"Manage your SpatiaLite databases within QGis" enter image description here

After installing the plugin you can run it.
enter image description here
You will receive a series of messages/errors stating that you do not have a spatialite db.
it will step you through getting one installed (choose a location for the file) and finally converting it to spatial.
Then in this dialog you can import your QGis layer.
enter image description here
Then: you don't really need this. It only works to create a new db.
From the QGIS menu
Layer | Save As...

From the QGIS 'Save vector layer as...' dialog box
Choose Spatialite from the Format drop down list.


You can right-click the layer and select "save layer as..." and choose spatiaLite as your format. Your only option there is to create a new database, i.e. you cannot add it to an existing database.

The QspatiaLite plugin adds a lot of functionality to QGIS, so give that a try as well.


There is a GUI application called spatialite-gui that allows you to import shapefiles and build spatial indexes.

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.