How Nail Works


Nail uses SQLite as its data storage mechanism. SQLite is a self-contained, file based database. If you have never heard of SQLite, it is definately worth having a look at. It is used in many high profile applications. I have used it in various aspects of my work and have found it to be extremely fast and reliable. The beauty of SQLite is that it is file based and requires no installation on the server. So an SQLite database can simply be copied to a webserver and it is ready to go.

SQLite by default, knows nothing about spatial data. In order to get Nail to work, I have designed a way of storing spatial data within an SQLite database.  I have also created some simple conversion tools that allow shapefiles and textfiles to be translated into the Nail format. More information on data loading can be found here. The Nail map interface cannot directly display data in other formats (such as shapefiles), all data to be displayed using Nail must be converted into the Nail database format first. The Nail database format is optimised for fast map generation. 

Nail stores vector data in tables within the Nail database. Unlike other GIS database formats (eg. ESRI geodatabase) the actual shape data is stored directly in a human readable database text field, rather than being hidden away in database objects. The best way to see for yourself how the nail database format works is to have a look inside the database. To do this, first download a copy of SQLiteSpy (a tool for interogating an SQLite Database). Then download a copy of the demo gis.db located here:

Now open gis.db using SQLiteSpy and see for yourself how Nail stores spatial data.