The steps you need to follow to complete this recipe are as follows:
- Unzip the wborders.zip archive to your working directory. You can find this archive in the book's dataset.
- Import the world countries shapefile (wborders.shp) in PostGIS using the ogr2ogr command. Using some of the options from ogr2ogr, you will import only the features from SUBREGION=2 (Africa), and the ISO2 and NAME attributes, and rename the feature class to africa_countries:
$ ogr2ogr -f PostgreSQL -sql "SELECT ISO2, NAME AS country_name FROM wborders WHERE REGION=2" -nlt MULTIPOLYGON PG:"dbname='postgis_cookbook' user='me' password='mypassword'" -nln africa_countries -lco SCHEMA=chp01 -lco GEOMETRY_NAME=the_geom wborders.shp
- Check if the shapefile ...