Getting ready

If you have not done so already, create a directory and copy the chapter's datasets; for Windows, use the following commands:

> mkdir C:\postgis_cookbook\data\chap05
> cp -r /path/to/book_dataset/chap05 C:\postgis_cookbook\data\chap05

For Linux or macOS, go into the folder you wish to use and run the following commands, where /path/to/book_dataset/chap05 is the path where you originally stored the book source code:

> mkdir -p data/chap05
> cd data/chap05
> cp -r /path/to/book_dataset/chap05

You should also create a new schema for this chapter in the database:

> psql -d postgis_cookbook -c "CREATE SCHEMA chp05" 

Get PostGIS Cookbook - Second 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.