Skip to content

Commit

Permalink
Upgrade PostGIS to 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicavet committed Oct 28, 2015
1 parent f510cd1 commit 77b084a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#
# This image includes the following tools
# - PostgreSQL 9.5
# - PostGIS 2.1.8 with raster, topology and sfcgal support
# - PostGIS 2.2 with raster, topology and sfcgal support
# - PgRouting
# - PDAL master
# - PostgreSQL PointCloud version master
#
# Version 1.6
# Version 1.7

FROM phusion/baseimage
MAINTAINER Vincent Picavet, vincent.picavet@oslandia.com
Expand Down Expand Up @@ -52,12 +52,12 @@ RUN cd SFCGAL && cmake . && make -j3 && make install
RUN rm -Rf SFCGAL

# Download and compile PostGIS
RUN wget http://download.osgeo.org/postgis/source/postgis-2.1.8.tar.gz
RUN tar -xzf postgis-2.1.8.tar.gz
RUN cd postgis-2.1.8 && ./configure --with-sfcgal=/usr/local/bin/sfcgal-config
RUN cd postgis-2.1.8 && make -j3 && make install
RUN wget http://download.osgeo.org/postgis/source/postgis-2.2.0.tar.gz
RUN tar -xzf postgis-2.2.0.tar.gz
RUN cd postgis-2.2.0 && ./configure --with-sfcgal=/usr/local/bin/sfcgal-config
RUN cd postgis-2.2.0 && make && make install
# cleanup
RUN rm -Rf postgis-2.1.8.tar.gz postgis-2.1.8
RUN rm -Rf postgis-2.2.0.tar.gz postgis-2.2.0

# Download and compile pgrouting
RUN git clone https://github.com/pgRouting/pgrouting.git &&\
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
NEWS items
==========

28/10/15 - Release 1.7
* Upgrade PostGIS to 2.2

30/07/15 - Release 1.6
* Upgrade Postgresql to 9.5
* Upgrade PostGIS
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This Docker image is a container with all latest PostgreSQL extensions needed to
It is based on Ubuntu 14.04 and features :

* PostgreSQL 9.5 (from PGDG packages)
* PostGIS 2.1.8 (compiled from release sources) with SFCGAL support (git master)
* PostGIS 2.2 (compiled from release sources) with SFCGAL support (git master)
* PgRouting (git master)
* PostgreSQL PointCloud extension (git master)
* PDAL (git master)
Expand All @@ -20,7 +20,7 @@ This Docker is aimed at tests and development. Do not use it for production purp
Just get me started !
---------------------

Make sure you have docker installed. On Ubuntu 14.04, Docker is named *docker.io*, replace the *docker* by *docker.io* in the following if needed.
Make sure you have docker installed. On Ubuntu 14.04, Docker is named *docker.io*, replace the *docker* by *docker.io* in the following if needed. It is advised to use the latest available Docker version from official packages. See : https://blog.docker.com/2015/07/new-apt-and-yum-repos/

If you just want to run a container with this image, you do not need this repository as the image is available on docker hub as a Trusted Build.
Just run the container and it will download the image if you do not already have it locally :
Expand All @@ -30,6 +30,7 @@ sudo docker run --rm -P --name pggis_test oslandia/pggis /sbin/my_init
```

If PostgreSQL server does not start and you see a lot of dots on the screen, see Known Problems below.

Connect to the database
-----------------------

Expand Down
12 changes: 6 additions & 6 deletions init_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ do
DBNAME=$(basename -s ".backup" "$f")
echo "Creating a new database $DBNAME.."
/usr/bin/psql -U pggis -h localhost -c "CREATE DATABASE $DBNAME WITH OWNER = pggis ENCODING = 'UTF8' TEMPLATE = template0 CONNECTION LIMIT = -1;" postgres
/usr/bin/psql -U pggis -h localhost -w -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION pgrouting; CREATE EXTENSION pointcloud; CREATE EXTENSION pointcloud_postgis; drop type if exists texture; create type texture as (url text,uv float[][]);" $DBNAME
/usr/bin/psql -U pggis -h localhost -w -f /usr/share/postgresql/9.5/contrib/postgis-2.1/sfcgal.sql -d $DBNAME
/usr/bin/psql -U pggis -h localhost -w -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION pgrouting; CREATE EXTENSION pointcloud; CREATE EXTENSION pointcloud_postgis; CREATE EXTENSION postgis_sfcgal; drop type if exists texture; create type texture as (url text,uv float[][]);" $DBNAME
# /usr/bin/psql -U pggis -h localhost -w -f /usr/share/postgresql/9.5/contrib/postgis-2.1/sfcgal.sql -d $DBNAME

echo "Restoring database $DBNAME.."
/usr/bin/pg_restore -U pggis -h localhost -d $DBNAME -w "$f"
Expand All @@ -48,8 +48,8 @@ do
DBNAME=$(basename -s ".sql" "$f")
echo "Creating a new database $DBNAME.."
/usr/bin/psql -U pggis -h localhost -c "CREATE DATABASE $DBNAME WITH OWNER = pggis ENCODING = 'UTF8' TEMPLATE = template0 CONNECTION LIMIT = -1;" postgres
/usr/bin/psql -U pggis -h localhost -w -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION pgrouting; CREATE EXTENSION pointcloud; CREATE EXTENSION pointcloud_postgis; drop type if exists texture; create type texture as (url text,uv float[][]);" $DBNAME
/usr/bin/psql -U pggis -h localhost -w -f /usr/share/postgresql/9.5/contrib/postgis-2.1/sfcgal.sql -d $DBNAME
/usr/bin/psql -U pggis -h localhost -w -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION postgis_sfcgal; CREATE EXTENSION pgrouting; CREATE EXTENSION pointcloud; CREATE EXTENSION pointcloud_postgis; drop type if exists texture; create type texture as (url text,uv float[][]);" $DBNAME
# /usr/bin/psql -U pggis -h localhost -w -f /usr/share/postgresql/9.5/contrib/postgis-2.1/sfcgal.sql -d $DBNAME
echo "Restoring database $DBNAME.."
/usr/bin/psql -U pggis -h localhost -d $DBNAME -w -f "$f"
echo "Restore done."
Expand All @@ -61,9 +61,9 @@ echo "Creating a new empty database..."
/usr/bin/psql -U pggis -h localhost -c "CREATE DATABASE pggis WITH OWNER = pggis ENCODING = 'UTF8' TEMPLATE = template0 CONNECTION LIMIT = -1;" postgres

# activate all needed extension in pggis database
/usr/bin/psql -U pggis -h localhost -w -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION pgrouting; CREATE EXTENSION pointcloud; CREATE EXTENSION pointcloud_postgis; drop type if exists texture;
/usr/bin/psql -U pggis -h localhost -w -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION postgis_sfcgal; CREATE EXTENSION pgrouting; CREATE EXTENSION pointcloud; CREATE EXTENSION pointcloud_postgis; drop type if exists texture;
create type texture as (url text,uv float[][]);" pggis
/usr/bin/psql -U pggis -h localhost -w -f /usr/share/postgresql/9.5/contrib/postgis-2.1/sfcgal.sql -d pggis
#/usr/bin/psql -U pggis -h localhost -w -f /usr/share/postgresql/9.5/contrib/postgis-2.1/sfcgal.sql -d pggis

echo "Database initialized. Connect from host with :"
echo "psql -h localhost -p <PORT> -U pggis -W pggis"
Expand Down

0 comments on commit 77b084a

Please sign in to comment.