Changes between Initial Version and Version 1 of UsersWikiPostGIS24Debian9src


Ignore:
Timestamp:
Aug 19, 2017, 8:06:54 AM (7 years ago)
Author:
chrismarx
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS24Debian9src

    v1 v1  
     1= How to install PostGIS 2.4 on Debian 9.x (''stretch'') from source =
     2
     3== WIP! Work in Progress! ==
     4
     5== Prerequisites ==
     6Several components are needed, which can either be built from source or installed from pre-built packages, as shown below.
     7
     8Install prerequisite packages using:
     9{{{
     10sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev libgdal-dev libproj-dev libjson0-dev xsltproc docbook-xsl docbook-mathml
     11}}}
     12
     13=== Build GEOS 3.4.x ===
     14PostGIS 2.1 is best used with GEOS >= 3.4 for several new features, however Debian wheezy only has GEOS 3.3.3 available in packages, so it needs to be built from source. If you don't need the new features, instead install the {{{libgeos-dev}}} package.
     15
     16There are multiple ways to build GEOS, but this is the simplest:
     17{{{
     18wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
     19tar xfj geos-3.4.2.tar.bz2
     20cd geos-3.4.2
     21./configure
     22make
     23sudo make install
     24cd ..
     25}}}
     26
     27== Build PostGIS ==
     28{{{
     29wget http://download.osgeo.org/postgis/source/postgis-2.1.8.tar.gz
     30tar xfz postgis-2.1.8.tar.gz
     31cd postgis-2.1.8
     32}}}
     33
     34A basic configuration for PostGIS 2.1, with raster and topology support:
     35{{{
     36./configure
     37make
     38sudo make install
     39sudo ldconfig
     40sudo make comments-install
     41}}}
     42
     43Lastly, enable the command-line tools to work from your shell:
     44{{{
     45sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql
     46sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/pgsql2shp
     47sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/raster2pgsql
     48}}}
     49
     50== Spatially enabling a database ==
     51
     52Connect to your database using pgAdminIII or psql, and use the commands to add the PostgreSQL extensions. To add PostGIS with raster support:
     53{{{
     54CREATE EXTENSION postgis;
     55}}}
     56
     57To add topology support, a second extension can be created on the database:
     58{{{
     59CREATE EXTENSION postgis_topology;
     60}}}