21

I want to create an application platform based on PostGIS data. I read the documentation where I saw the prerequisite to install GEOS, GDAL and Proj4. The main problem is I am using windows platform.

Can anybody refer me where I can get full documentation on how to install PostGIS, GDAL, GEOS, Proj4 on Windows with all their libraries?

0

7 Answers 7

30

You don't have to worry about any of those prerequisites when installing PostGIS on Windows. You just need to install the Postgresql installer for your platform. You can then launch the Application Stack Builder to install PostGIS.

enter image description here

enter image description here

You can find more detailed installation instructions at the Boston GIS web site.

8

Thanks to @pateto777 answer and other sources like this and this , I managed to have a "portable" installation of PostGIS on a windows 7 machine without admin rights.

  1. Select the packages and download the binaries zip files. I went for:

    • postgresql-9.6.3-3-windows-x64-binaries.zip
    • postgis-bundle-pg96-2.3.3x64.zip
  2. Unzip the content in a merged folder, I used "pgsql", so within this folder you will have the folders: bin, doc, gdal-data, include, lib, pgAdmin 4, share, utils, symbols and utils. No "data" folder yet!

  3. Create a cluster before using it. I used a batch file in the merged folder to create it. I called FirstBatch.bat

@ECHO ON
REM The script sets environment variables helpful for PostgreSQL
@SET PATH="%~dp0bin";%PATH%
@SET PGDATA=%~dp0data
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5439
@SET PGLOCALEDIR=%~dp0share\locale
"%~dp0bin\initdb" -U postgres -A trust -E utf8
ECHO "Click enter to exit"
pause
  1. Start postgresql. I used a batch file in the merged folder to start it. It has to be running while you want to access the database. I called NormalBatch.bat.
@ECHO ON
REM The script sets environment variables helpful for PostgreSQL
@SET PATH="%~dp0\bin";%PATH%
@SET PGDATA=%~dp0\data
@SET PGDATABASE=geodb
@SET PGUSER=postgres
@SET PGPORT=5439
@SET PGLOCALEDIR=%~dp0\share\locale
"%~dp0bin\pg_ctl" -D "%~dp0data" -l logfile start
ECHO "Click enter to stop"
pause
"%~dp0\bin\pg_ctl" -D "%~dp0/data" stop
  1. While the previous batch is running, create a geodatabase called "geodb". I used this batch to connect to the shell
REM shell interface
"%~dp0bin\psql" -p 5439 -U postgres

then type:

postgres=#create database geodb;
postgres=#\connect geodb;
geodb=#CREATE EXTENSION postgis;
geodb=#CREATE EXTENSION postgis_topology;
geodb=#\q

Voilà! A postGIS database called geodb is available for user postgres on port 5439

5

you can check out Portable GIS V3 which is newly released. the package contains what you need about GIS.

  • Desktop GIS packages QGIS (with GRASS plugin) version 1.8
  • FWTools (GDAL and OGR toolkit)
  • Apache2 and Php5
  • PostgreSQL (version 9.0)/Postgis (version 1.5)
  • Mapserver 5.6 and 6, OpenLayers.
  • Python 2.7
  • Loader- for loading gml such as Ordnance Survey Mastermap into a PostgreSQL Database
  • Utilities- portable firefox, pdf reader and text editor

port

i hope it helps you...

5

If you like the manual installations, you can follow these steps:

  1. Downloaded the binary files. In my case I used:

    postgresql-9.5.3-1-windows-x64-binaries.zip

    postgis-bundle-pg95-2.2.2x64-2.zip

  2. Copy all the content from postgis to postgresql in the root folder. At the end you will find the folders: bin, gdal-data, lib, pgAdmin III, share, utils and more files.

  3. Assuming Postgres is already installed, connect to the shell and type:

    create database geodb;

    \connect geodb;

    CREATE EXTENSION postgis;

    CREATE EXTENSION postgis_topology;

These 2 extensions are enough for working.

1
  • geodb=# CREATE EXTENSION postgis; returns ERROR: no schema has been selected to create in Commented Jul 6, 2022 at 6:57
4

I think R.K. answer is all you need, but if helps, I wrote a blog posts about installing and configuring PostGIS Raster on Windows

EDIT: I forgot to renew the domain and now it points to a porn site. Sorry for the inconvenience :-(

2
  • The link in this answer took me to a porn site. Beware.
    – Jon
    Commented Dec 11, 2020 at 18:06
  • 1
    Wow! Thanks for reporting it. I'll change it. Commented Feb 9, 2021 at 15:10
1

Thought I would provide an update as the earlier user guides are a bit out of date.

I used a combination of the website from @Hani Dradi which really helped with the PostgreSQL installation and a second website as I was not sure what applications I should install with PostgreSQL using Stack Builder - the answer was only PostGIS.

https://www.geo-gate.com/docs/gis-environment-installation/installing-postgresql/
https://learnosm.org/en/osm-data/postgresql/

Also note that pgAdmin now runs in the browser
https://stackoverflow.com/questions/50435656/pgadmin-4-always-open-in-browser-not-as-a-standalone-desktop-application

0

This page outlines screenshots for installing PostgreSQL and PostGIS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.