Geoscience Reference
In-Depth Information
Fig. 14.10
Landsat 8 quality assessment (QA) band
01 Algorithm has low confidence that this condition exists (0-33% confidence);
10 Algorithm has medium confidence that this condition exists (34-66% confi-
dence);
11 Algorithm has high confidence that this condition exists (67-100% confidence).
On its website,
24
the United States Geological Survey (USGS) provides a no-cost
tool to extract the bit-packed information in the QA band for easy interpretation. In
the next snippet we create a utility,
bqa2cloud
, to create a cloud/cirrus mask from
the QA band.
The first part of the program is dedicated to command line parsing (see also
Sect.
14.3.6
). The options
-nocloud
,
-cloud
and
-cirrus
can be used to set
the values of the mask. By default, both cloud and cirrus pixels are set to a value of 1
and no-cloud is set to a value of 0. For this utility, both an input and output raster must
be provided. The input raster dataset is the 16-bit quality GeoTIFF image, defined by
the first command line argument not linked to an option. The resulting cloud mask is
written to a new 16-bit raster dataset, defined by the second command line argument
not linked to an option.
#include
<stdlib.h>
#include
<string>
#include
<vector>
#include
<sstream>
#include
<iostream>
#include
<fstream>
#include
"gdal_priv.h"
using namespace
std;
int
main(
int
argc,
char
**argv) {
string stlsBQAimageFilename;//input QA band filename
string stlsCLDimageFilename;//output cloud/cirrus mask
Search WWH ::
Custom Search