Swapping image bands

Our eyes can only see colors in the visible spectrum as combinations of red, green, and blue (RGB). Air and space-borne sensors can collect wavelengths of the energy outside of the visible spectrum. To view this data, we move images representing different wavelengths of light reflectance in and out of the RGB channels to make color images.

These images often end up as bizarre and alien color combinations that can make visual analysis difficult. An example of a typical satellite image is shown in the following Landsat 7 satellite scene near the NASA Stennis Space Center in Mississippi along the Gulf of Mexico, which is a leading center for remote sensing and geospatial analysis in general:

Most of the vegetation appears ...

Get Learning Geospatial Analysis with Python - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.