Setting up the database

Because the ShapeEditor will make heavy use of PostGIS, we first need to set up a PostgreSQL user and database for the ShapeEditor to use and then enable the PostGIS extension for this database. Let's do that now:

  1. Open a terminal or command-line window and type the following:
    createuser -P shapeeditor
    

    Tip

    Don't forget to add the -U postgres command-line option or use sudo for this command if you need to run Postgres under a different user account.

  2. You will be prompted to enter a password for the shapeeditor Postgres user. Make sure you remember the password you use, as you'll need to use it when setting up the ShapeEditor so that it can access the database.We next need to create the database itself:
    % createdb shapeeditor ...

Get Python Geospatial Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.