I'm trying to understand how to install PostGIS2.0 on Windows7. The PostGIS site has the following suggestions:
PostGIS Experimental Binaries PostGIS 2.0.0SVN Binaries with Raster, Topology support + Extras (Tiger Geocoder 2010) As of November 25th, 2011 (r8242) includes GEOS 3.3.2dev r3516, Proj 4.6.1, JSON-c 0.9, libgdal 1.9 SVN r23320 (VERSIONS prior to (r7923) require a dump reload since operators have changed. We now have the 3D spatial indexes, 3D box operators, KNN GIST for 9.1, and 2 raster map algebra)
More details about what has been fixed/added can be found at PostGIS 2.0.0 and PostGIS 1.5.3/1.5.4 fixes , What is new in PostGIS 2.0, PostGIS Raster support, and improved Topology support These are 32-bit binaries so will not work on 64-bit PostgreSQL. We are working on getting 64-bit binaries out as well, but are running into some stumbling blocks. For the time being -- if you are on Windows 64-bit, you must install the 32-bit PostgreSQL to use these.
For PostgreSQL 8.4 w/ Loader/Dumper including GUI For PostgreSQL 9.0 (compiled against PostgreSQL 9.0.3) w/ Loader/Dumper including GUI For PostgreSQL 9.1 (compiled against PostgreSQL 9.1.0 - note 9.1 structure changed in beta 1 so this will not work with alpha releases
but should be fine for all beta, release candidate releases and final 9.1.0 release) w/ Loader/Dumper including GUI. Also includes extensions files to install using new PostgreSQL 9.1+ CREATE EXTENSION syntax. To install:
First copy the share/extension files into your PostgreSQL share/extension folder. Then in any database you'd like to spatially enable, run at least postgis (which contains both geometry and raster support) and
optionally postgis_topology commands.
CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;
I currently have PostGIS 1.5 installed on PostgreSQL 8.4. This is what my folder structure looks like:
I don't fully understand these instructions:
First copy the share/extension files into your PostgreSQL share/extension folder.
Then in any database you'd like to spatially enable, run at least postgis (which contains both geometry and raster support) and optionally postgis_topology commands.
I've downloaded postgisgui_pgadmin-2.0.0svn
and postgis-pg84-binaries-2.0.0svn
. In my original folder structure I don't have a folder extension
within share
. Do I just copy the contents of postgis-pg84-binaries-2.0.0svn
into this folder? What does it mean to run at least postgis
? I've also tried to follow the detailed instructions at the following blog.
EDIT: I have installed Postgresql 9.1 with PostGIS 1.5.3. I am trying to figure out where to copy the PostGIS 2.0 binaries. It seems like I should be copying them into the folders here:
but the advice suggests placing them in the share/extension folder.
I tried copying the entire folder into share/extension/
and then editing the makepostgis.bat
file to make it relevant to my file system (the port is 5434 as I have two instances of Postgresql running).
set PGPORT=5434
set PGHOST=localhost
set PGUSER=postgres
set PGPASSWORD=****
set THEDB=template_postgis20
set PGBIN=C:\Program Files (x86)\PostgreSQL\9.1\bin\
set PGLIB=C:\Program Files (x86)\PostgreSQL\9.1\lib\
When I run this file as an administrator, I get the following error:
C:\Windows\system32>set PGPORT=5434
C:\Windows\system32>set PGHOST=localhost
C:\Windows\system32>set PGUSER=postgres
C:\Windows\system32>set PGPASSWORD=****
C:\Windows\system32>set THEDB=template_postgis20
C:\Windows\system32>set PGBIN=C:\Program Files (x86)\PostgreSQL\9.1\bin\
C:\Windows\system32>set PGLIB=C:\Program Files (x86)\PostgreSQL\9.1\lib\
C:\Windows\system32>set POSTGISVER=2.0
C:\Windows\system32>xcopy bin\*.* "C:\Program Files (x86)\PostgreSQL\9.1\bin\"
File not found - *.*
0 File(s) copied
C:\Windows\system32>xcopy /I /S bin\postgisgui\* "C:\Program Files (x86)\PostgreSQL\9.1\bin\\postgisgui"
File not found - *
0 File(s) copied
C:\Windows\system32>xcopy lib\*.* "C:\Program Files (x86)\PostgreSQL\9.1\lib\"
File not found - *.*
0 File(s) copied
C:\Windows\system32>"C:\Program Files (x86)\PostgreSQL\9.1\bin\\psql" -c "CREATE DATABASE template_postgis20"
ERROR: database "template_postgis20" already exists
C:\Windows\system32>"C:\Program Files (x86)\PostgreSQL\9.1\bin\\psql" -d "template_postgis20" -c "CREATE LANGUAGE plpgs
ql"
ERROR: language "plpgsql" already exists
C:\Windows\system32>"C:\Program Files (x86)\PostgreSQL\9.1\bin\\psql" -d "template_postgis20" -f "share\contrib\postgis
-2.0\postgis.sql"
share/contrib/postgis-2.0/postgis.sql: No such file or directory
....the errors continue....