3

I could need some help from an experienced unix user. As far as I understand, the mapnik library only uses the common sqlite3 library by default. Though mapnik supports spatial sqlite databases, spatialite has to be a statically linked extension for sqlite.

I found the spatialite amalgamation which includes sqlite. But I need it the other way -- sqlite with spatialite included.

Could I get some brief instruction on how to link spatialite into sqlite as a static library? Or is it possible to link mapnik against the spatialite amalgamation instead of sqlite?

I work on Ubuntu 14.04 and Mavericks.

Spatialite Sources:

https://www.gaia-gis.it/spatialite-2.3.0/amalgamation.html

https://www.gaia-gis.it/spatialite-2.3.0/libspatialite-amalgamation-2.3.0.tar.gz

Thanks!

  • The SpatiaLite amalgamation is horribly outdates and [deprecated](https://groups.google.com/forum/#!topic/spatialite-users/zfUn0d9k9Aw). – CL. Sep 17 '14 at 10:51
  • So I build spatialite 4.2 from source. You have a hint for the extension linking? – 01Track1mp3 Sep 17 '14 at 10:59

1 Answers1

1

I do not know anything about mapnik, but I have written a blog post about how to convert a SQLite to Spatialite which includes steps how to build/install/link Spatialite as well as how to load it in SQLite: SQLite to Spatialite

-- 0. enter the SQLite CLI interface
dm295@ubuntu:~$ sqlite3

-- 1. load the spatial extension
sqlite> .load /usr/local/lib/mod_spatialite.so sqlite3_modspatialite_init
Dušan Maďar
  • 9,269
  • 5
  • 49
  • 64