<commit_before>.. _geospatial_libs:

===============================
Installing Geospatial libraries
===============================

GeoDjango uses and/or provides interfaces for the following open source
geospatial libraries:

========================  ====================================  ================================  ==========================
Program                   Description                           Required                          Supported Versions
========================  ====================================  ================================  ==========================
:ref:`GEOS <ref-geos>`    Geometry Engine Open Source           Yes                               3.4, 3.3, 3.2
`PROJ.4`_                 Cartographic Projections library      Yes (PostgreSQL and SQLite only)  4.8, 4.7, 4.6, 4.5, 4.4
:ref:`GDAL <ref-gdal>`    Geospatial Data Abstraction Library   No (but, required for SQLite)     1.9, 1.8, 1.7
:ref:`GeoIP <ref-geoip>`  IP-based geolocation library          No                                1.4
`PostGIS`__               Spatial extensions for PostgreSQL     Yes (PostgreSQL only)             2.0, 1.5, 1.4, 1.3
`SpatiaLite`__            Spatial extensions for SQLite         Yes (SQLite only)                 4.1, 4.0, 3.0, 2.4, 2.3
========================  ====================================  ================================  ==========================

Note that older or more recent versions of these libraries *may* also work
totally fine with GeoDjango. Your mileage may vary.

..
    Libs release dates:
    GEOS 3.2.0 2009-12-14
    GEOS 3.3.0 2011-05-30
    GEOS 3.4.0 2013-08-11
    GDAL 1.7.1 2010-02-08
    GDAL 1.8.0 2011-01-13
    GDAL 1.9.0 2012-01-03
    GDAL 1.10.0 2013-04-29 (support to be confirmed)
    PostGIS 1.3.0 2007-08-09
    PostGIS 1.4.0 2009-07-24
    PostGIS 1.5.0 2010-02-04
    PostGIS 2.0.0 2012-04-03
    PostGIS 2.1.0 2013-08-17 (support to be confirmed)
    SpatiaLite 2.3.0 2009-04-06
    Spatialite 2.4.0 2010-11-14
    Spatialite 3.0.0 2011-12-30
    Spatialite 4.0.0 2012-11-25
    Spatialite 4.1.0 2013-06-04

.. admonition::  Install GDAL

    While :ref:`gdalbuild` is technically not required, it is *recommended*.
    Important features of GeoDjango (including the :ref:`ref-layermapping`,
    geometry reprojection, and the geographic admin) depend on its
    functionality.

.. note::

    The GeoDjango interfaces to GEOS, GDAL, and GeoIP may be used
    independently of Django.  In other words, no database or settings file
    required -- just import them as normal from :mod:`django.contrib.gis`.

.. _PROJ.4: http://trac.osgeo.org/proj/
__ http://postgis.refractions.net/
__ http://www.gaia-gis.it/gaia-sins/


On Debian/Ubuntu, you are advised to install the following packages which will
install, directly or by dependency, the required geospatial libraries:

.. code-block:: bash<commit_msg>Confirmed support for PostGIS 2.1 and GDAL 1.10<commit_after>.. _geospatial_libs:

===============================
Installing Geospatial libraries
===============================

GeoDjango uses and/or provides interfaces for the following open source
geospatial libraries:

========================  ====================================  ================================  ==========================
Program                   Description                           Required                          Supported Versions
========================  ====================================  ================================  ==========================
:ref:`GEOS <ref-geos>`    Geometry Engine Open Source           Yes                               3.4, 3.3, 3.2
`PROJ.4`_                 Cartographic Projections library      Yes (PostgreSQL and SQLite only)  4.8, 4.7, 4.6, 4.5, 4.4
:ref:`GDAL <ref-gdal>`    Geospatial Data Abstraction Library   No (but, required for SQLite)     1.10, 1.9, 1.8, 1.7
:ref:`GeoIP <ref-geoip>`  IP-based geolocation library          No                                1.4
`PostGIS`__               Spatial extensions for PostgreSQL     Yes (PostgreSQL only)             2.1, 2.0, 1.5, 1.4, 1.3
`SpatiaLite`__            Spatial extensions for SQLite         Yes (SQLite only)                 4.1, 4.0, 3.0, 2.4, 2.3
========================  ====================================  ================================  ==========================

Note that older or more recent versions of these libraries *may* also work
totally fine with GeoDjango. Your mileage may vary.

..
    Libs release dates:
    GEOS 3.2.0 2009-12-14
    GEOS 3.3.0 2011-05-30
    GEOS 3.4.0 2013-08-11
    GDAL 1.7.1 2010-02-08
    GDAL 1.8.0 2011-01-13
    GDAL 1.9.0 2012-01-03
    GDAL 1.10.0 2013-04-29
    PostGIS 1.3.0 2007-08-09
    PostGIS 1.4.0 2009-07-24
    PostGIS 1.5.0 2010-02-04
    PostGIS 2.0.0 2012-04-03
    PostGIS 2.1.0 2013-08-17
    SpatiaLite 2.3.0 2009-04-06
    Spatialite 2.4.0 2010-11-14
    Spatialite 3.0.0 2011-12-30
    Spatialite 4.0.0 2012-11-25
    Spatialite 4.1.0 2013-06-04

.. admonition::  Install GDAL

    While :ref:`gdalbuild` is technically not required, it is *recommended*.
    Important features of GeoDjango (including the :ref:`ref-layermapping`,
    geometry reprojection, and the geographic admin) depend on its
    functionality.

.. note::

    The GeoDjango interfaces to GEOS, GDAL, and GeoIP may be used
    independently of Django.  In other words, no database or settings file
    required -- just import them as normal from :mod:`django.contrib.gis`.

.. _PROJ.4: http://trac.osgeo.org/proj/
__ http://postgis.refractions.net/
__ http://www.gaia-gis.it/gaia-sins/


On Debian/Ubuntu, you are advised to install the following packages which will
install, directly or by dependency, the required geospatial libraries:

.. code-block:: bash
{'fraction_non_alphanumeric': 0.2253666954270923, 'fraction_numerical': 0.0817946505608283, 'mean_word_length': 2.6270337922403004, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6874922', 'n_tokens_mistral': 2136, 'n_tokens_neox': 1720, 'n_words': 524}