OpenGeo

Introduction to PostGIS

Previous topic

Section 1: Introduction to PostGIS

Next topic

Section 3: Creating a Spatial Database

Section 2: Installation of PostgreSQLΒΆ

PostGIS is an extension to the PostgreSQL relation database management system. This section will first walk through the installation of PostgreSQL and then PostGIS on a Windows XP environment using the provided installer. The latest PostgreSQL installer can be downloaded from http://www.postgresql.org/download/windows .

  1. In the directory C:\workshops\PostGIS\software\ you will find the PostgreSQL installer, called postgresql-8.4.1-1-windows.exe. Double click to execute.

  2. Enjoy the warm welcome, courtesy of EnterpriseDB, then click Next.

    _images/install-02.png
  3. In the event that you want to install PostgreSQL application binaries into a non-standard directory, enter the path here. For the purposes of this workshop we will use the default. Click Next.

    _images/install-03.png
  4. The directory where PostgreSQL data will reside can also be installed into a non-standard directory. This is especially useful to drop your data on a RAID array. We have no such hardware, so we will be using the default path. Click Next.

    _images/install-04.png
  5. Enter a password for the newly-created “postgres” superuser account. Remember this password! We will use the password postgres in our examples, so we will recommend you use this as well.

    _images/install-05.png
  6. This is your opportunity to enter a non-standard port for PostgreSQL. For our purposes we will accept the default (5432) and click Next.

    _images/install-06.png

    Note

    Binding PostgreSQL to an alternate port is helpful when upgrading. You can run two instances in parallel until all data has been migrated over and tested, then swap the ports.

  7. The Default Locale option will reflect the locale (location) setting of the host operating system and is sufficient for this workshop. Uncheck the option that says Install pl/pgsql in template1 database. Click Next.

    _images/install-07.png
  8. And now we’re ready to go. Click Next...

    _images/install-08.png
  9. ...and wait for the installation to complete.

    _images/install-09.png
  10. Ensure that the Launch Stack Builder at exit? option is selected, then click Finish.

    _images/install-10.png

    Note

    The Application Stack Builder provides you an easy way to install a variety of helpful add-on software to PostgreSQL; PostGIS is one of many such applications.

  11. The Stack Builder needs to know which database to install extensions for. Select the local option as shown and click Next.

    _images/install-11.png
  12. There are a number of categories to choose from. PostGIS is available under the “Spatial Extensions” group. Select PostGIS 1.4 for PostgreSQL 8.4 v1.4.0 and click Next.

    _images/install-12.png
  13. There is only one Australian mirror for PostgreSQL downloads. Select the FTP option and click Next.

    _images/install-13.png
  14. The review page lists all selected packages. You should have only PostGIS 1.4.0 selected. Click Next.

    _images/install-14.png
  15. The download is small and shouldn’t take very long.

    _images/install-15.png
  16. Once the download is complete you will be presented with the following screen. Click Next to continue.

    _images/install-16.png
  17. PostGIS is licensed under the GNU General Public License, the text of which is displayed in the following dialog. Select I Agree to continue.

    _images/install-17.png
  18. The PostGIS installer can create a spatially enabled database automatically after installation. For this workshop, we will not make use of this database. Uncheck the Create spatial database box and click Next.

    _images/install-18.png
  19. PostGIS needs to know the location of the target PostgreSQL installation. It will determine this automatically if PostgreSQL is installed in the default location. Click Next to continue.

    _images/install-19.png
  20. Enter the password you defined for the “postgres” user when installing PostgreSQL and click Next to continue.

    _images/install-20.png
  21. After installation, click Close to return to the Stack Builder.

    _images/install-21.png
  22. The installation is now complete. Click Finish to exit.

    _images/install-22.png