SpatiaLite is a library for extending SQLite core for efficient Spatial functions. I am currently using it, during research. It’s a bit cumbersome to install it with Django 1.8. After hours of struggling, I finally installed it on my Debian system.
In order to not waste some much hours, I wrote whole process to this gist.(64 lines)
But I want to write some of gotchas here:
- Before starting make sure you have installed build-essential.
- Make sure you also installed python2.7-dev package, this is required for packages that uses Python.h
- + don’t forget to install libexpat1, libexpat1-dev, both required for compiling spatialise-tools.
- There is a slight difference with paths during the compilation. Some of the libraries tend to look only to usr/lib, usr/include, but others just only check usr/local/bin, /usr/local/include.
- On my local system (Mac OS X), after following steps from Django’s Docs on Spatialite, I added this to my settings.py
123SPATIALITE_LIBRARY_PATH='/usr/local/lib/mod_spatialite.dylib'# However, you may need to comment this out on your remote system or# maybe a simple if platform.platform() == "Darwin" check here.'