3,2,1, GO !
1. Open http://www.gaia-gis.it/spatialite/, download spatialite-gui GUI and unzip it.
3. Download « the init_spatialite.sql script required in order to initialize the Spatial MetaData tables » and start it with Spatialite GUI
5. Use the function Load Shapefile of spatialite-gui to load the roads, for example. It takes some seconds to load 125256 roads, in my case.
7. And start playing with the spatial functions: select * from roads where MBRContains(BuildMBR(7.5,46.5,7.6,46.6),Geometry) = 1; Pretty fast, you will see !
8. If you don’t like the GUI, use the command line:
FINISHED ! It should have taken less than 5 minutes. It took more time to write this blog…
Nothing really new (Personal Geodatabase, SDF, others exist for a while) except the extrem simplicity, the file portability (cross plattforms), the possibility to access the shapefile as « virtual tables » (you can start SQL statements directly on shapefiles) and the OS license.
Of course PostGIS or Oracle Spatial will provide more functions or will extract data faster but I can imagine dozen of applications where the simplicity of spatialite is an huge advantage (SQLite is the most widely deployed SQL database engine in the world). Imagine a complete GIS system on an iPhone or Apache as cartographic server.
Thanks to Alessandro Furieri.
Keep It Simple… but not Stupid !