In this recipe, you will write a Python script to import data from the NetCDF format to PostGIS.
NetCDF is an open standard format, widely used for scientific applications, and can contain multiple raster datasets, each composed of a spectrum of bands. For this purpose, you will use the GDAL Python bindings and the popular NumPy (http://www.numpy.org/) scientific library.
- If you are using Windows, be sure to install OSGeo4W, as suggested in the initial instructions for this chapter. This will include Python and GDAL Python bindings with NumPy support.
For Linux users, in case you did not do it yet, follow the initial instructions for this chapter and create a Python virtual environment in order to keep a Python-isolated environment to be used for all the Python recipes in this book. Then, activate it:
$ source postgis-cb-env/bin/activate
- For this recipe, you need the GDAL Python bindings and NumPy, the latter being needed by a GDAL method...