QGIS Export – How to Export Shapefile to SpatiaLite

qgisspatial-databasespatialite

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?

Best Answer

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.