OpenGeo

OpenGeo Stack Workshop

Previous topic

Installing PostGIS

Next topic

Loading Spatial Data

Creating a Spatial Database

In previous sections a PostGIS was installed and is now ready for us. In this section a new PostGIS database will be created using the PostgreSQL administration console pgAdmin.

  1. Open the PostgresSQL Administration Console by opening the Start Menu and navigating to Programs ‣ PostgreSQL 8.2 ‣ pgAdmin III.

    ../_images/db_create1.jpg

    Running the PostgreSQL adminstration console, pgAdmin

  2. In pgAdmin connect to the database by right-clicking on PostgreSQL Database Server 8.2 (localhost:5432) and selecting Connect.

    ../_images/db_create2.jpg

    Connecting to the database with pgAdmin

  3. In the Connect To Server dialog, enter the password “postgres”, check off Store Password, and click OK.

    ../_images/db_create3.jpg

    Specifying the database password

  4. In the Object Browser right-click on Databases and select New Database...

    ../_images/db_create4.jpg

    Creating a new database

  5. In the New Database... dialog:

    1. Enter “bayarea” in the Name field
    2. Select UTF8 from the Encoding drop down list
    3. Select template_postgis from the Template drop down list
    4. Click OK
    ../_images/db_create5.jpg

    Creating a PostGIS database

At this point a new PostGIS database has been created and is ready for use. In the next section the new database will be loaded with data.