How to do it...

The steps you need to follow to complete this recipe are as shown:

  1. Inspect the structure of the CSV file, firenews.csv, which you can find within the book dataset (if you are on Windows, open the CSV file with an editor such as Notepad).
      $ cd ~/postgis_cookbook/data/chp01/      $ head -n 5 firenews.csv

The output of the preceding command is as shown:

  1. Connect to PostgreSQL, create the chp01 SCHEMA, and create the following table:
 $ psql -U me -d postgis_cookbook postgis_cookbook=> CREATE EXTENSION postgis; postgis_cookbook=> CREATE SCHEMA chp01; postgis_cookbook=> CREATE TABLE chp01.firenews ( x float8, y float8, place varchar(100), ...

Get PostGIS Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.