The GDAL library allows you to read and write both vector and raster data. To install GDAL on Windows, you will need the appropriate binaries:
Note
You can download OSGeo4W, which contains the binaries, at: https://trac.osgeo.org/osgeo4w/
When you have the binaries, you can install gdal
using conda
, as follows:
conda install -c conda-forge gdal
In the following sections, you will learn how to load and work with a .tif
file.
Now that you have gdal
installed, import it using:
from osgeo import gdal
GDAL 2 is the most recent version. If you have an older version of gdal
installed, you may need to import it using the following code:
import gdal
If this is the case, you may want to look into upgrading your version of gdal
. Once you have gdal
imported, you can open a raster image. First, let's get an image from the web. The Earth Data Analysis Center at the University of New Mexico maintains the Resource Geographic Information...