Prerequisites
A PostgreSQL server 8.1 or above is needed. The PostGIS extension must be installed on the server. An administration tools like pgAdmin on some client machine is recommended. The following script files are needed:
| File | Location |
|---|---|
| prepare.sql | This postgrid installation directory |
| lwpostgis.sql |
PostGIS installation directory |
| spatial_ref_sys.sql | PostGIS installation directory |
| postgis-update.sql | This postgrid installation directory |
| postgrid.sql | This postgrid installation directory |
| postgrid-model.sql |
This postgrid installation directory |
| postgrid-comments.sql |
This postgrid installation directory |
Steps
- Create an empty database. Any name can fit. For example "Coverages". Specify UTF8 as the encoding character.
- Run prepare.sql for the database created at step 1. Note that this script will creates "geoadmin" and "geouser" roles. If those roles already exist, remove the "CREATE ROLE" statements. If different role names are wanted, search and replace every occurrences of "geoadmin" and "geouser" in prepare.sql, postgis-update.sql and postgrid.sql scripts.
- Open lwpostgis.sql (from your PostGIS installation directory) in a SQL editor and add the following line at the begining of the script: SET search_path = postgis, pg_catalog; Then run the script. The PostGIS tables and functions should be created in the "postgis" schema instead of the default "public" one.
- Open spatial_ref_sys.sql (from your PostGIS installation directory) in a SQL editor and add the same line than at the previous step. Then run the script.
- Run postgis-update.sql. It will adds some vertical coordinate reference systems to the "spatial_ref_sys" table.
- Run postgrid.sql. It should creates the minimal set of tables for running PostGrid.
- Run postgrid-comments.sql. It should creates a few additional columns and tables for commenting elements like layers, formats, etc. PostGrid itself doesn't use those comments.
- Run postgrid-model.sql. It should creates some additional tables for creating new coverages from linear models.
- To finish with, add the variable search_path with values "public, postgis, postgrid".
It can be done by executing the following line in a PostgreSQL client like pgAdmin or psql, supposing the database name is Coverages :
ALTER DATABASE "Coverages" SET search_path=public, postgis, postgrid;