Installing PostGIS 1.5 onto PostgreSQL 9.0 on Windows
After installing PostgreSQL 9.0 on Windows using the packaged installer on my server, I did the following:
- Download the PostGIS 1.5 Windows binaries from http://postgis.refractions.net/download/windows/pg90/postgis-pg90-binaries-1.5.3.zip
- Extract the files into a folder e.g. C:\Program Files\postgis-pg90-binaries-1.5.3.
- Use a text editor and open up the makepostgisdb.bat file.
- If necessary, change the PGPORT, PGHOST, PGUSER, and PGPASSWORD settings to match the Windows PostgreSQL installation.
- Uncomment the last line to create the database defined by the THEDB setting as a template PostGIS database e.g template_postgis15. Close and save the file.
- Run the batch file makepostgisdb.bat.
PostGIS is installed and a template database is created.
Configure PostgreSQL for network access
By default, PostgreSQL is configured not to accept any network database requests. I had to do edit the configuration parameters to allow network access.
- On the server, select Start | All Programs | PostgreSQL 9.0 | pgAdmin III.
The pgAdmin III application appears. - In the Object browser pane, double click on the PostgreSQL 9.0 (localhost:5432) node. Enter the password if prompted.
Connection to the server is established. - Select Tools | Server Configuration | pg_hba.conf.
The Backend Access Configuration Editor appears. - Double click the empty last row.
The Client Access Configuration dialog appears. - Toggle Enabled on. Choose host for Type, all for Database, all for User and md5 for Method. Type in an appropriate IP Address for your network e.g. 192.168.8.0/24.
Note: In this example, I am allowing access for any clients with the IP address pattern 192.168.8.*. - Click OK.
- Select File | Save. Press Yes if prompted.
- Select File | Reload Server. Press Yes if prompted.
- Close the Client Access Configuration and Backend Access Configuration dialogs.
Create and configure the Postgis database
- In the Object browser, expand and select Login Roles node.
- Select Edit | New Object | New Login Role.
The New Login Role dialog box appears. - In the Role Name field, type in gdouser. In the Password and Password(again) fields, type in gdouser.
- Click OK.
The login is created. - In the Object browser, select the Database(s) node.
- Select Edit | New Object | New Database.
The New Database dialog box appears. - In the Name field, type in gdotest. Choose gdouser as the Owner. Choose template_postgis15 as the Template.
- Click OK.
The database is created.
Configuring the PostGIS GDO server on the client
- On the client machine, I downloaded the PostGISGDObin.zip package from http://geomediapostgis.codeplex.com and extracted to a folder e.g. C:\Program Files\PostGISGDO\.
- Run Register.bat.
The data server is registered with GeoMedia. - Double click the file PsgDBUtils.exe.
The PostGIS GDO Database Utilities appear. - Click New Connection.
The New Connection dialog box appears. - In the Server field, type in the address or name. In the Database field, type in gdotest. In the User field, type in gdouser. In the Password field, type in gdouser. Click OK.
The utility is connected to the PostGIS database. - Click Create INGR Metadata Tables.
The metadata tables are created. - Click Run script.
The Open dialog box appears. - Browse and choose the file USSampleProjCS.sql. Click Open. Click OK when prompted.
Note: this script will add the Albers Equal Area coordinate system to the PostGIS database for working with the sample USSampleData.gws workspace. - Click Close.
- Start GeoMedia and open up the sample workspace USSampleData.gws.
- Select Warehouses | New Connection.
The New Connection dialog box appears. - Choose PostGIS Connection Type.
- In the Server field, type in the IP address or node name of the PostGIS server.
- In the Database field, type in gdotest.
- In the User and Password fields, type in gdouser. Click OK.
GeoMedia is connected to the PostGIS database.
Note: You should now have full read/write access to the PostGIS database.
No comments:
Post a Comment