-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Geospatial Development By Example with Python
By :

Now that we know the basics of iterating through the image, which allows us to process many bands together without running out of memory, let's produce some fancier results.
Since we have Landsat's red, green, and blue bands, we can create an image with true colors. This means an image with colors similar to what they would be if we were directly observing the scene (for example, the grass is green and the soil is brown). To do this, we will explore a little bit more of Python's iterators.
The Landsat 8 RGB bands are respectively bands 4, 3, and 2. Following the concept that we want to automate tasks and processes, we won't repeat the commands for each one of the bands. We will program Python to do this as follows:
import os import cv2 as cv import itertools from osgeo import gdal, gdal_array import numpy as np
Change the font size
Change margin width
Change background colour