Advantages of using spatialite over shapefile?

Shapefiles are the lowest common denominator of GIS vector data file exchange: send an archive of shapefiles, and you can pretty much guarantee that someone will be able to build a basic GIS from it.

SpatiaLite's advantages include:

  • everything's in one file; none of the shp/shx/dbf/idx/prj per layer mess.
  • logic as well as data can be included, in the form of VIEWs and TRIGGERs.
  • built-in spatial indices, which allow rapid searches of large areas.
  • they are real (if slightly limited, mostly in multi-user access) database systems, with no database admin skills required.

But there are some disadvantages:

  • not everyone can use them.
  • they are still mostly limited to geometries built from nodes and straight lines; if you need splines and surfaces, look elsewhere.

Shapefiles are bound to one type of geometry, so you get a bunch of files for a single project. The field names are restricted too due to using an antiquarian database format.

In spatialite, you can hold the whole project data in one file; and name the fields how you want (well, almost).

The only disadvantage of spatialite is the fast update cycle, making it difficult to read or write data written in another (older) version.


In addition to scruss' answer, shapefiles has some limitations:

  • max field name length is 10 characters
  • maximum file size (.dbf / .shp) is 2GB
  • numeric attributes are stored as characters (integers/floats), causing potential problems with rounding etc
  • NULL values are interpreted differently between systems