Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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

share|improve this answer

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.

share|improve this 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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