[OSM-dev] Spatialite in OSM context

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Thu Sep 23 09:07:13 BST 2010

> On Sep 22, 2010, at 3:38 PM, Chris Browet wrote:
>> Hi,
>> I wanted to know if someone already used Spatialite in an OSM context?
> Yes, Mapnik supports both SQLite and Spatialite through an SQLite
datasource plugin.
> You can push OSM data extracts from PostGIS to SQLite using
> http://trac.mapnik.org/browser/trunk/utils/pgsql2sqlite and its not too
hard to touch up the few parts of the osm.xml that using postgres
> syntax so that the Mapnik layer definitions (SQL queries) are compatible
with SQLite.

That work flow (osm2pgsql+PostGIS+pgsql2sqlite) does not help the end user
very much. But perhaps someday there will be ready made Spatialite
database files for download, with indexes and perhaps a bunch of views.
Then it would be possible to download one single data file bundled with,
let's say, QGis or OpenJUMP project file, or Mapnik style file or
Mapserver mapfile, and then just run the application. I believe I will
start building Spatialite and Mapserver mapfile bundles for Finland later
this year.
Unfortunately Spatialite does not have similar support than PostgreSQL
hstore for storing all the tags, or does it? I tried once to create a
Spatialite database with osm_point_tags, osm_line_tags and
osm_polygon_tags tables and use osm_id field as a foreign key, but at
least then osm_id's in osm_line and osm_polygon tables were not unique and
my idea did not work.

-Jukka Rahkonen-

More information about the dev mailing list