summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorKenial Lee <keniallee@gmail.com>2014-11-25 19:48:36 -0800
committerTim Graham <timograham@gmail.com>2014-11-26 14:05:21 -0500
commit5f79da581440dba6275f70e8a6ef440a32dbb895 (patch)
tree1545f0078df198600a226da4ac7ad33a0793b1cf /docs/ref
parent87254532fba9605d1da8f134f07dfc11a4434200 (diff)
[1.7.x] Fixed #23901 -- Documented how to use SpatiaLite with Homebrew.
Backport of cc870b8ef5e3464c6f051e3ef0a25dfc4b597452 from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/gis/install/spatialite.txt39
1 files changed, 37 insertions, 2 deletions
diff --git a/docs/ref/contrib/gis/install/spatialite.txt b/docs/ref/contrib/gis/install/spatialite.txt
index bcb5ecd587..d4651d35e3 100644
--- a/docs/ref/contrib/gis/install/spatialite.txt
+++ b/docs/ref/contrib/gis/install/spatialite.txt
@@ -166,8 +166,13 @@ to build and install::
Mac OS X-specific instructions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Mac OS X users should follow the instructions in the :ref:`kyngchaos` section,
-as it is much easier than building from source.
+To install the SpatiaLite library and tools, Mac OS X users can choose between
+:ref:`kyngchaos` and `Homebrew`_.
+
+KyngChaos
+^^^^^^^^^
+
+First, follow the instructions in the :ref:`kyngchaos` section.
When :ref:`create_spatialite_db`, the ``spatialite`` program is required.
However, instead of attempting to compile the SpatiaLite tools from source,
@@ -188,6 +193,23 @@ add the following to your ``settings.py``:
__ http://www.gaia-gis.it/spatialite-2.3.1/binaries.html
+Homebrew
+^^^^^^^^
+
+`Homebrew`_ handles all the SpatiaLite related packages on your behalf,
+including SQLite3, SpatiaLite, PROJ, and GEOS. Install them like this::
+
+ $ brew update
+ $ brew install spatialite-tools
+ $ brew install gdal
+
+Finally, for GeoDjango to be able to find the SpatiaLite library, add the
+following to your ``settings.py``::
+
+ SPATIALITE_LIBRARY_PATH='/usr/local/lib/mod_spatialite.dylib'
+
+.. _Homebrew: http://brew.sh/
+
.. _create_spatialite_db:
Creating a spatial database for SpatiaLite
@@ -226,3 +248,16 @@ Then, use the ``spatialite`` command to initialize a spatial database::
inside your ``settings.py``.
__ http://www.gaia-gis.it/spatialite-2.3.1/resources.html
+
+.. note::
+
+ When running ``manage.py migrate`` with a SQLite (or SpatiaLite) database,
+ the database file will be automatically created if it doesn't exist. In
+ this case, if your models contain any geometry columns, you'll see this
+ error::
+
+ CreateSpatialIndex() error: "no such table: geometry_columns"
+
+ It's because the table creation queries are executed without spatial
+ metadata tables. To avoid this, make the database file before executing
+ ``manage.py migrate`` as described above.