Geospatial Development By Example with Python
上QQ阅读APP看书,第一时间看更新

Installing GDAL and OGR

GDAL (Geospatial Data Abstraction Library) is composed of two packages that come together: OGR handles geospatial vector file formats, including coordinate system transformations and vector operations. GDAL is the raster part of the library, and in version 1.11, it comes packed with 139 drivers that can read, and some even create rasters. GDAL also comes packed with functions for raster transformations and calculations such as resizing, clipping, reprojecting, and so on.

In the following tables, there's an excerpt of the list of GDAL and OGR drivers with the most common formats that you may find:

The following table describes the OGR drivers:

Note

You can find the full GDAL and OGR API documentation and the complete list of drivers at http://gdal.org/python/.

Windows

Again, we will use a wheel for the installation. Repeat the same procedure as before:

  1. Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/.
  2. Now, search for GDAL and download the file named GDAL‑1.11.3‑cp27‑none‑win32.whl.
  3. Finally, install it with pip, as we did before.

Ubuntu Linux

Perform the following steps:

  1. Go to the terminal or open a new one.
  2. Then, enter the following command:
    sudo apt-get install python-gdal