Skip to content

Commit

Permalink
Fixed #26137 -- Confirmed support for SpatiaLite 4.2/4.3 and added in…
Browse files Browse the repository at this point in the history
…structions.
  • Loading branch information
timgraham committed Jan 29, 2016
1 parent 04564eb commit 93897a6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
4 changes: 3 additions & 1 deletion docs/ref/contrib/gis/install/geolibs.txt
Expand Up @@ -13,7 +13,7 @@ Program Description Required
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes (SQLite only) 2.0, 1.11, 1.10, 1.9, 1.8, 1.7
:doc:`GeoIP <../geoip>` IP-based geolocation library No 1.4
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.1, 2.0
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.1, 4.0, 3.0
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3, 4.2, 4.1, 4.0, 3.0
======================== ==================================== ================================ ============================

Note that older or more recent versions of these libraries *may* also work
Expand All @@ -33,6 +33,8 @@ totally fine with GeoDjango. Your mileage may vary.
Spatialite 3.0.0 2011-12-30
Spatialite 4.0.0 2012-11-25
Spatialite 4.1.0 2013-06-04
Spatialite 4.2.0 2014-07-25
Spatialite 4.3.0 2015-09-07

.. admonition:: Install GDAL

Expand Down
35 changes: 18 additions & 17 deletions docs/ref/contrib/gis/install/spatialite.txt
Expand Up @@ -5,20 +5,30 @@ Installing Spatialite
`SpatiaLite`__ adds spatial support to SQLite, turning it into a full-featured
spatial database.

Check first if you can install Spatialite from system packages or binaries. For
example, on Debian-based distributions, try to install the ``spatialite-bin``
package. For Mac OS X, follow the
:ref:`specific instructions below<spatialite_macosx>`. For Windows, you may
find binaries on `Gaia-SINS`__ home page. In any case, you should always
be able to :ref:`install from source<spatialite_source>`.
First, check if you can install Spatialite from system packages or binaries.

When you are done with the installation process, skip to :ref:`create_spatialite_db`.
For example, on Debian-based distributions, try to install the
``spatialite-bin`` package. For distributions that package SpatiaLite 4.2+,
install ``libsqlite3-mod-spatialite``.

For Mac OS X, follow the :ref:`instructions below<spatialite_macosx>`.

For Windows, you may find binaries on the `Gaia-SINS`__ home page.

In any case, you should always be able to :ref:`install from source
<spatialite_source>`.

__ https://www.gaia-gis.it/fossil/libspatialite
__ http://www.gaia-gis.it/gaia-sins/

.. _spatialite_source:

.. admonition:: ``SPATIALITE_LIBRARY_PATH`` setting required for SpatiaLite 4.2+

If you're using SpatiaLite 4.2+, you must put this in your settings::

SPATIALITE_LIBRARY_PATH = 'mod_spatialite'

Installing from source
======================

Expand Down Expand Up @@ -91,7 +101,7 @@ KyngChaos

First, follow the instructions in the :ref:`kyngchaos` section.

When :ref:`create_spatialite_db`, the ``spatialite`` program is required.
When creating a SpatiaLite database, the ``spatialite`` program is required.
However, instead of attempting to compile the SpatiaLite tools from source,
download the `SpatiaLite Binaries`__ for OS X, and install ``spatialite`` in a
location available in your ``PATH``. For example::
Expand Down Expand Up @@ -124,12 +134,3 @@ 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
==========================================

When running ``manage.py migrate`` with a SQLite or SpatiaLite database, the
database file will be automatically created if it doesn't exist. Django will
also ensure that the spatial metadata are initialized in the database.
12 changes: 1 addition & 11 deletions docs/ref/contrib/gis/testing.txt
Expand Up @@ -3,7 +3,7 @@ Testing GeoDjango apps
======================

Included in this documentation are some additional notes and settings
for :ref:`testing-postgis` and :ref:`testing-spatialite` users.
for :ref:`testing-postgis` users.

.. _testing-postgis:

Expand Down Expand Up @@ -79,16 +79,6 @@ a simple way to add superuser privileges to your database user.
By default, the PostGIS installer on Windows includes a template
spatial database entitled ``template_postgis``.

.. _testing-spatialite:

SpatiaLite
==========

Make sure the necessary spatial tables are created in your test spatial
database, as described in :ref:`create_spatialite_db`. Then just do this::

$ python manage.py test

.. _geodjango-tests:

GeoDjango tests
Expand Down

0 comments on commit 93897a6

Please sign in to comment.