PostGIS Support Matrix
Versions of PostgreSQL supported by which versions of PostGIS
PostgreSQL Version | PostGIS 1.3 | PostGIS 1.4 | PostGIS 1.5 | PostGIS 2.0 | PostGIS 2.1 | PostGIS 2.2 | PostGIS 2.3 Trunk |
7.2-7.4 | Yes (not windows) | No | No | No | No | No | No |
8.0 | Yes (not windows) | No | No | No | No | No | No |
8.1 | Yes | No | No | No | No | No | No |
8.2 | Yes | Yes | No | No | No | No | No |
8.3 | Yes | Yes | Yes | No | No | No | No |
8.4 | Yes | Yes | Yes | Yes (not recommended) | No | No | No |
9.0 | No | No | Yes | Yes (not recommended) | Yes (not recommended) | No | No |
9.1 | No | No | Yes | Yes | Yes | Yes | No* |
9.2 | No | No | Yes* (1.5.6+) | Yes | Yes | Yes | Yes |
9.3 | No | No | No | No | Yes | Yes | Yes |
9.4 | No | No | No | No | Yes | Yes | Yes |
9.5 | No | No | No | No | No* | Yes | Yes |
9.6 | No | No | No | No | No* | Yes* | Yes
|
sudo apt-get install binutils libproj-dev gdal-bin libgeoip1 gdal-bin libgeos-dev libgdal-dev
apt-get install postgresql-9.4 postgresql-server-dev-9.4
Setting system library path¶
On GNU/Linux systems, there is typically a file in /etc/ld.so.conf
, which may include additional paths from files in another directory, such as/etc/ld.so.conf.d
. As the root user, add the custom library path (like/usr/local/lib
) on a new line in ld.so.conf
. This is one example of how to do so:
$ sudo echo /usr/local/lib >> /etc/ld.so.conf
$ sudo ldconfig
$ wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
$ tar xjf geos-3.4.2.tar.bz2
$ cd geos-3.4.2
$ ./configure
$ make
$ sudo make install
$ cd ..
$ wget http://download.osgeo.org/proj/proj-4.9.1.tar.gz
$ wget http://download.osgeo.org/proj/proj-datumgrid-1.5.tar.gz
$ tar xzf proj-4.9.1.tar.gz
$ cd proj-4.9.1/nad
$ tar xzf ../../proj-datumgrid-1.5.tar.gz
$ cd ..
$ ./configure
$ make
$ sudo make install
$ cd ..
$ wget http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz
$ tar xzf gdal-1.11.2.tar.gz
$ cd gdal-1.11.2
#on getting error download more recent version of gdal like gdal 1.11.5
$ ./configure
$ make # Go get some coffee, this takes a while.
$ sudo make install
$ cd ..
$ wget http://download.osgeo.org/postgis/source/postgis-2.1.5.tar.gz
$ tar xzf postgis-2.1.5.tar.gz
$ cd postgis-2.1.5
$ ./configure
$ make
$ sudo make install
$ cd ..
pip install psycopg2 --ignore-installed --no-cache-dir
from shell connect to postgres server
#install postgres fedora
dnf -y install postgresql postgresql-server
systemctl enable postgresql
/usr/bin/postgresql-setup --initdb
systemctl start postgresql
su - postgres
psql -d template1
CREATE EXTENSION IF NOT EXISTS postgis;
now create database
on exist database
\connect dbname
CREATE EXTENSION IF NOT EXISTS postgis;
django.contrib.gis.db.backends.postgis is extension of postgresql_psycopg2 so you could change db driver in settings, create new db with spatial template and then migrate data to new db (South is great for this). By itself geodjango is highly dependent on DB inner methods thus, unfortunately, you couldn't use it with regular db.
Other way - you could make use of django's multi-db ability, and create extra db for geodjango models.