{"title":"Installing Geospatial libraries","version":"6.1","locale":"el","docname":"ref/contrib/gis/install/geolibs","url":"/el/6.1/ref/contrib/gis/install/geolibs/","canonical":"https://djangodocs.dev/el/6.1/ref/contrib/gis/install/geolibs/","summary":"Geospatial libraries Link to this heading # GeoDjango uses and/or provides interfaces for the following open source geospatial libraries: Program Description…","html":"<h1>Installing Geospatial libraries<a class=\"heading-anchor\" href=\"#installing-geospatial-libraries\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<section id=\"geospatial-libraries\">\n<span id=\"geolibs-list\"></span><h2>Geospatial libraries<a class=\"heading-anchor\" href=\"#geospatial-libraries\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>GeoDjango uses and/or provides interfaces for the following open source\ngeospatial libraries:</p>\n<div class=\"table-scroll\" role=\"region\" tabindex=\"0\" aria-label=\"Table\"><table class=\"docutils align-default\">\n<thead>\n<tr class=\"row-odd\"><th class=\"head\"><p>Program</p></th>\n<th class=\"head\"><p>Description</p></th>\n<th class=\"head\"><p>Required</p></th>\n<th class=\"head\"><p>Supported Versions</p></th>\n</tr>\n</thead>\n<tbody>\n<tr class=\"row-even\"><td><p><a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/geos/#geos-overview\"><span class=\"std std-ref\">GEOS</span></a></p></td>\n<td><p>Geometry Engine Open Source</p></td>\n<td><p>Yes</p></td>\n<td><p>3.14, 3.13, 3.12, 3.11, 3.10</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p><a class=\"reference external\" href=\"https://proj.org/\">PROJ</a></p></td>\n<td><p>Cartographic Projections library</p></td>\n<td><p>Yes (PostgreSQL and SQLite only)</p></td>\n<td><p>9.x, 8.x, 7.x, 6.x</p></td>\n</tr>\n<tr class=\"row-even\"><td><p><a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/gdal/#gdal-overview\"><span class=\"std std-ref\">GDAL</span></a></p></td>\n<td><p>Geospatial Data Abstraction Library</p></td>\n<td><p>Yes</p></td>\n<td><p>3.13, 3.12, 3.11, 3.10, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p><a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/geoip2/#geoip2-overview\"><span class=\"std std-ref\">GeoIP</span></a></p></td>\n<td><p>IP-based geolocation library</p></td>\n<td><p>No</p></td>\n<td><p>2</p></td>\n</tr>\n<tr class=\"row-even\"><td><p><a class=\"reference external\" href=\"https://postgis.net/\">PostGIS</a></p></td>\n<td><p>Spatial extensions for PostgreSQL</p></td>\n<td><p>Yes (PostgreSQL only)</p></td>\n<td><p>3.6, 3.5, 3.4, 3.3, 3.2</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p><a class=\"reference external\" href=\"https://www.gaia-gis.it/gaia-sins/\">SpatiaLite</a></p></td>\n<td><p>Spatial extensions for SQLite</p></td>\n<td><p>Yes (SQLite only)</p></td>\n<td><p>5.1, 5.0, 4.3</p></td>\n</tr>\n</tbody>\n</table>\n</div>\n<p>Note that older or more recent versions of these libraries <em>may</em> also work\ntotally fine with GeoDjango. Your mileage may vary.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p>The GeoDjango interfaces to GEOS, GDAL, and GeoIP may be used\nindependently of Django. In other words, no database or settings file\nrequired – import them as normal from <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/#module-django.contrib.gis\" title=\"django.contrib.gis: Geographic Information System (GIS) extensions for Django\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">django.contrib.gis</span></code></a>.</p>\n</aside>\n<p>On Debian/Ubuntu, you are advised to install the following packages which will\ninstall, directly or by dependency, the required geospatial libraries:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>sudo<span class=\"w\"> </span>apt-get<span class=\"w\"> </span>install<span class=\"w\"> </span>binutils<span class=\"w\"> </span>libproj-dev<span class=\"w\"> </span>gdal-bin\n</code></pre></div>\n<p>Please also consult platform-specific instructions if you are on <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/install/#macos\"><span class=\"std std-ref\">macOS</span></a>\nor <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/install/#windows\"><span class=\"std std-ref\">Windows</span></a>.</p>\n</section>\n<section id=\"building-from-source\">\n<span id=\"build-from-source\"></span><h2>Building from source<a class=\"heading-anchor\" href=\"#building-from-source\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>When installing from source on UNIX and GNU/Linux systems, please follow\nthe installation instructions carefully, and install the libraries in the\ngiven order. If using MySQL or Oracle as the spatial database, only GEOS\nis required.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p>On Linux platforms, it may be necessary to run the <code class=\"docutils literal notranslate\"><span class=\"pre\">ldconfig</span></code> command\nafter installing each library. For example:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>make<span class=\"w\"> </span>install\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>ldconfig\n</code></pre></div>\n</aside>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p>macOS users must install <a class=\"reference external\" href=\"https://developer.apple.com/xcode/\">Xcode</a> in order to compile software from source.</p>\n</aside>\n<section id=\"geos\">\n<span id=\"geosbuild\"></span><h3>GEOS<a class=\"heading-anchor\" href=\"#geos\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>GEOS is a C++ library for performing geometric operations, and is the default\ninternal geometry representation used by GeoDjango (it’s behind the «lazy»\ngeometries). Specifically, the C API library is called (e.g., <code class=\"docutils literal notranslate\"><span class=\"pre\">libgeos_c.so</span></code>)\ndirectly from Python using ctypes.</p>\n<p>First, download GEOS from the GEOS website and untar the source archive:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>wget<span class=\"w\"> </span>https://download.osgeo.org/geos/geos-X.Y.Z.tar.bz2\n$<span class=\"w\"> </span>tar<span class=\"w\"> </span>xjf<span class=\"w\"> </span>geos-X.Y.Z.tar.bz2\n</code></pre></div>\n<p>Then step into the GEOS directory, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">build</span></code> folder, and step into\nit:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>geos-X.Y.Z\n$<span class=\"w\"> </span>mkdir<span class=\"w\"> </span>build\n$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>build\n</code></pre></div>\n<p>Then build and install the package:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>cmake<span class=\"w\"> </span>-DCMAKE_BUILD_TYPE<span class=\"o\">=</span>Release<span class=\"w\"> </span>..\n$<span class=\"w\"> </span>cmake<span class=\"w\"> </span>--build<span class=\"w\"> </span>.\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>cmake<span class=\"w\"> </span>--build<span class=\"w\"> </span>.<span class=\"w\"> </span>--target<span class=\"w\"> </span>install\n</code></pre></div>\n<section id=\"troubleshooting\">\n<h4>Troubleshooting<a class=\"heading-anchor\" href=\"#troubleshooting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<section id=\"can-t-find-geos-library\">\n<h5>Can’t find GEOS library<a class=\"heading-anchor\" href=\"#can-t-find-geos-library\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>When GeoDjango can’t find GEOS, this error is raised:</p>\n<div class=\"code-block\" data-language=\"text\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Text</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Text code\"><code>ImportError: Could not find the GEOS library (tried &quot;geos_c&quot;). Try setting GEOS_LIBRARY_PATH in your settings.\n</code></pre></div>\n<p>The most common solution is to properly configure your <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/install/#libsettings\"><span class=\"std std-ref\">Library environment settings</span></a> <em>or</em>\nset <a class=\"reference internal\" href=\"#geoslibrarypath\"><span class=\"std std-ref\">GEOS_LIBRARY_PATH</span></a> in your settings.</p>\n<p>If using a binary package of GEOS (e.g., on Ubuntu), you may need to\n<a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/install/#binutils\"><span class=\"std std-ref\">Install binutils</span></a>.</p>\n</section>\n<section id=\"geos-library-path\">\n<span id=\"geoslibrarypath\"></span><h5><code class=\"docutils literal notranslate\"><span class=\"pre\">GEOS_LIBRARY_PATH</span></code><a class=\"heading-anchor\" href=\"#geos-library-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>If your GEOS library is in a non-standard location, or you don’t want to\nmodify the system’s library path then the <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/geos/#std-setting-GEOS_LIBRARY_PATH\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">GEOS_LIBRARY_PATH</span></code></a>\nsetting may be added to your Django settings file with the full path to the\nGEOS C library. For example:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"nv\">GEOS_LIBRARY_PATH</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"s1\">&#39;/home/bob/local/lib/libgeos_c.so&#39;</span>\n</code></pre></div>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p>The setting must be the <em>full</em> path to the <strong>C</strong> shared library; in\nother words you want to use <code class=\"docutils literal notranslate\"><span class=\"pre\">libgeos_c.so</span></code>, not <code class=\"docutils literal notranslate\"><span class=\"pre\">libgeos.so</span></code>.</p>\n</aside>\n<p>See also <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/geos/#geos-exceptions-in-logfile\"><span class=\"std std-ref\">My logs are filled with GEOS-related errors</span></a>.</p>\n</section>\n</section>\n</section>\n<section id=\"proj4\">\n<span id=\"id3\"></span><h3>PROJ<a class=\"heading-anchor\" href=\"#proj4\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p><a class=\"reference external\" href=\"https://proj.org/\">PROJ</a> is a library for converting geospatial data to different coordinate\nreference systems.</p>\n<p>First, download the PROJ source code:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>wget<span class=\"w\"> </span>https://download.osgeo.org/proj/proj-X.Y.Z.tar.gz\n</code></pre></div>\n<p>… and datum shifting files (download <code class=\"docutils literal notranslate\"><span class=\"pre\">proj-datumgrid-X.Y.tar.gz</span></code> for\nPROJ &lt; 7.x) <a class=\"footnote-reference brackets\" href=\"#id8\" id=\"id4\" role=\"doc-noteref\"><span class=\"fn-bracket\">[</span>1<span class=\"fn-bracket\">]</span></a>:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>wget<span class=\"w\"> </span>https://download.osgeo.org/proj/proj-data-X.Y.tar.gz\n</code></pre></div>\n<p>Next, untar the source code archive, and extract the datum shifting files in\nthe <code class=\"docutils literal notranslate\"><span class=\"pre\">data</span></code> subdirectory. This must be done <em>prior</em> to configuration:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>tar<span class=\"w\"> </span>xzf<span class=\"w\"> </span>proj-X.Y.Z.tar.gz\n$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>proj-X.Y.Z/data\n$<span class=\"w\"> </span>tar<span class=\"w\"> </span>xzf<span class=\"w\"> </span>../../proj-data-X.Y.tar.gz\n$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>../..\n</code></pre></div>\n<p>For PROJ 9.x and greater, releases only support builds using <code class=\"docutils literal notranslate\"><span class=\"pre\">CMake</span></code> (see\n<a class=\"reference external\" href=\"https://proj.org/community/rfc/rfc-7.html#rfc7\">PROJ RFC-7</a>).</p>\n<p>To build with <code class=\"docutils literal notranslate\"><span class=\"pre\">CMake</span></code> ensure your system meets the <a class=\"reference external\" href=\"https://proj.org/install.html#build-requirements\">build requirements</a>.\nThen create a <code class=\"docutils literal notranslate\"><span class=\"pre\">build</span></code> folder in the PROJ directory, and step into it:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>proj-X.Y.Z\n$<span class=\"w\"> </span>mkdir<span class=\"w\"> </span>build\n$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>build\n</code></pre></div>\n<p>Finally, configure, make and install PROJ:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>cmake<span class=\"w\"> </span>..\n$<span class=\"w\"> </span>cmake<span class=\"w\"> </span>--build<span class=\"w\"> </span>.\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>cmake<span class=\"w\"> </span>--build<span class=\"w\"> </span>.<span class=\"w\"> </span>--target<span class=\"w\"> </span>install\n</code></pre></div>\n</section>\n<section id=\"gdal\">\n<span id=\"gdalbuild\"></span><h3>GDAL<a class=\"heading-anchor\" href=\"#gdal\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p><a class=\"reference external\" href=\"https://gdal.org/\">GDAL</a> is an excellent open source geospatial library that has support for\nreading most vector and raster spatial data formats. Currently, GeoDjango only\nsupports <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/gdal/#gdal-vector-data\"><span class=\"std std-ref\">GDAL’s vector data</span></a> capabilities <a class=\"footnote-reference brackets\" href=\"#id9\" id=\"id5\" role=\"doc-noteref\"><span class=\"fn-bracket\">[</span>2<span class=\"fn-bracket\">]</span></a>.\n<a class=\"reference internal\" href=\"#geosbuild\"><span class=\"std std-ref\">GEOS</span></a> and <a class=\"reference internal\" href=\"#proj4\"><span class=\"std std-ref\">PROJ</span></a> should be installed prior to building GDAL.</p>\n<p>First download the latest GDAL release version and untar the archive:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>wget<span class=\"w\"> </span>https://download.osgeo.org/gdal/X.Y.Z/gdal-X.Y.Z.tar.gz\n$<span class=\"w\"> </span>tar<span class=\"w\"> </span>xzf<span class=\"w\"> </span>gdal-X.Y.Z.tar.gz\n</code></pre></div>\n<p>For GDAL 3.6.x and greater, releases only support builds using <code class=\"docutils literal notranslate\"><span class=\"pre\">CMake</span></code>. To\nbuild with <code class=\"docutils literal notranslate\"><span class=\"pre\">CMake</span></code> create a <code class=\"docutils literal notranslate\"><span class=\"pre\">build</span></code> folder in the GDAL directory, and step\ninto it:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>gdal-X.Y.Z\n$<span class=\"w\"> </span>mkdir<span class=\"w\"> </span>build\n$<span class=\"w\"> </span><span class=\"nb\">cd</span><span class=\"w\"> </span>build\n</code></pre></div>\n<p>Finally, configure, make and install GDAL:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>$<span class=\"w\"> </span>cmake<span class=\"w\"> </span>-DCMAKE_BUILD_TYPE<span class=\"o\">=</span>Release<span class=\"w\"> </span>..\n$<span class=\"w\"> </span>cmake<span class=\"w\"> </span>--build<span class=\"w\"> </span>.\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>cmake<span class=\"w\"> </span>--build<span class=\"w\"> </span>.<span class=\"w\"> </span>--target<span class=\"w\"> </span>install\n</code></pre></div>\n<p>If you have any problems, please see the troubleshooting section below for\nsuggestions and solutions.</p>\n<section id=\"gdaltrouble\">\n<span id=\"id7\"></span><h4>Troubleshooting<a class=\"heading-anchor\" href=\"#gdaltrouble\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<section id=\"can-t-find-gdal-library\">\n<h5>Can’t find GDAL library<a class=\"heading-anchor\" href=\"#can-t-find-gdal-library\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>When GeoDjango can’t find the GDAL library, configure your <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/install/#libsettings\"><span class=\"std std-ref\">Library environment settings</span></a>\n<em>or</em> set <a class=\"reference internal\" href=\"#gdallibrarypath\"><span class=\"std std-ref\">GDAL_LIBRARY_PATH</span></a> in your settings.</p>\n</section>\n<section id=\"gdal-library-path\">\n<span id=\"gdallibrarypath\"></span><h5><code class=\"docutils literal notranslate\"><span class=\"pre\">GDAL_LIBRARY_PATH</span></code><a class=\"heading-anchor\" href=\"#gdal-library-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>If your GDAL library is in a non-standard location, or you don’t want to\nmodify the system’s library path then the <a class=\"reference internal\" href=\"/el/6.1/ref/contrib/gis/gdal/#std-setting-GDAL_LIBRARY_PATH\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">GDAL_LIBRARY_PATH</span></code></a>\nsetting may be added to your Django settings file with the full path to\nthe GDAL library. For example:</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"nv\">GDAL_LIBRARY_PATH</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"s1\">&#39;/home/sue/local/lib/libgdal.so&#39;</span>\n</code></pre></div>\n<p class=\"rubric\">Footnotes</p>\n<aside class=\"footnote-list brackets\">\n<aside class=\"footnote brackets\" id=\"id8\" role=\"doc-footnote\">\n<span class=\"label\"><span class=\"fn-bracket\">[</span><a role=\"doc-backlink\" href=\"#id4\">1</a><span class=\"fn-bracket\">]</span></span>\n<p>The datum shifting files are needed for converting data to and from\ncertain projections.\nFor example, the PROJ string for the <a class=\"reference external\" href=\"https://spatialreference.org/ref/epsg/3857/\">Google projection (900913 or 3857)</a> requires the <code class=\"docutils literal notranslate\"><span class=\"pre\">null</span></code>\ngrid file only included in the extra datum shifting files. It is easier\nto install the shifting files now, than to debug a problem caused\nby their absence later.</p>\n</aside>\n<aside class=\"footnote brackets\" id=\"id9\" role=\"doc-footnote\">\n<span class=\"label\"><span class=\"fn-bracket\">[</span><a role=\"doc-backlink\" href=\"#id5\">2</a><span class=\"fn-bracket\">]</span></span>\n<p>Specifically, GeoDjango provides support for the <a class=\"reference external\" href=\"https://gdal.org/user/vector_data_model.html\">OGR</a> library, a component of\nGDAL.</p>\n</aside>\n</aside>\n</section>\n</section>\n</section>\n</section>","rootId":"installing-geospatial-libraries","toc":[{"title":"Geospatial libraries","anchor":"geospatial-libraries","children":[]},{"title":"Building from source","anchor":"building-from-source","children":[{"title":"GEOS","anchor":"geos","children":[{"title":"Troubleshooting","anchor":"troubleshooting","children":[{"title":"Can’t find GEOS library","anchor":"can-t-find-geos-library","children":[]},{"title":"GEOS_LIBRARY_PATH","anchor":"geos-library-path","children":[]}]}]},{"title":"PROJ","anchor":"proj4","children":[]},{"title":"GDAL","anchor":"gdal","children":[{"title":"Troubleshooting","anchor":"gdaltrouble","children":[{"title":"Can’t find GDAL library","anchor":"can-t-find-gdal-library","children":[]},{"title":"GDAL_LIBRARY_PATH","anchor":"gdal-library-path","children":[]}]}]}]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/el/6.1/ref/"},{"docname":"ref/contrib/index","title":"contrib packages","url":"/el/6.1/ref/contrib/"},{"docname":"ref/contrib/gis/index","title":"GeoDjango","url":"/el/6.1/ref/contrib/gis/"},{"docname":"ref/contrib/gis/install/index","title":"GeoDjango Installation","url":"/el/6.1/ref/contrib/gis/install/"}],"prev":{"docname":"ref/contrib/gis/install/index","title":"GeoDjango Installation","url":"/el/6.1/ref/contrib/gis/install/"},"next":{"docname":"ref/contrib/gis/install/postgis","title":"Installing PostGIS","url":"/el/6.1/ref/contrib/gis/install/postgis/"},"formats":{"html":"/el/6.1/ref/contrib/gis/install/geolibs/","markdown":"/el/6.1/ref/contrib/gis/install/geolibs.md","json":"/el/6.1/ref/contrib/gis/install/geolibs.json"},"source":"https://github.com/django/django/blob/stable/6.1.x/docs/ref/contrib/gis/install/geolibs.txt","official":"https://docs.djangoproject.com/el/6.1/ref/contrib/gis/install/geolibs/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10"],"inLocales":["en","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}