How to do it...

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

  1. Analyze the structure of the Global_24h.csv file (in Windows, open the CSV file with an editor such as Notepad):
      $ cd ~/postgis_cookbook/data/chp01/      $ head -n 5 Global_24h.csv

The output of the preceding command is as follows:

  1. Create a GDAL virtual data source composed of just one layer derived from the Global_24h.csv file. To do so, create a text file named global_24h.vrt in the same directory where the CSV file is and edit it as follows:
 <OGRVRTDataSource> <OGRVRTLayer name="Global_24h"> <SrcDataSource>Global_24h.csv</SrcDataSource> <GeometryType>wkbPoint</GeometryType> ...

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.