All of the code and data referenced in the book can be downloaded here. If you plan to use your own data, you can get by with just the code download.
The data zip contains only vector data. For information on downloading
the raster mentioned in the book, see the natural_earth.txt file.