R: NAIP, NDVI, NDWI

Introduction:

Manipulating rasters and imagery can be important elements in addressing both spatial and research questions. For example, anyone who has used and manipulated USGS's National Hydrography Dataset knows its limitations in identifying streams, wetlands, and even lakes. Depending on the type of work you are doing, you might be better suited using imagery to determine water bodies. Similarly, analysts might want to know the distribution of vegetation across a study area. Here I manipulated 4 band imagery from the National Agricultural Imagery Program (NAIP) to calculate NDWI for water, and NDVI for vegetation. I also used the NAIP imagery to run an unsupervised classification on the NDWI and NDVI, explored the relationship between the blue, green, red, and near infrared bands from the NAIP imagery, and characterized the spectral properties in terms of the distinct NLCD land classes.

Methods: NAIP Imagery of Muddy Creek and Wolford Reservoir, Colorado

One spring day while driving back from Steamboat Springs, we stopped at Muddy Creek and enjoyed some excellent fishing below Wolford Reservoir. I was surprised to learn the amount of public access available below Wolford and thought it would be interesting to examine the landscape surrounding this meandering tailwater. First, I explored how the area is characterized from the spectral imagery, by exploring the relationship between bands. Below I compared Blue vs. Green bands, and Red vs NIR bands. The blue and green bands were highly correlated with an r2 of 0.98, while the red and NIR bands were distinct (r2=0.12). Why would I be interested in these relationships? Depending on the analysis, you could remove the blue or green band to reduce data noise and collinearity.

Methods: Calculating NDVI, NDWI, Classification

I further wanted to identify areas of distinct vegetation, and water. To classify these areas I calculated both NDVI and NDWI. Next, using a k-means clustering approach, I classified the NAIP imagery based on NDVI scores.

Results:

Ultimately, I reclassified both NDVI (>0.25) and NDWI (>0.3) to produce a clear visual representation of areas that are clearly vegetation, and areas that are clearly water.

Spectral Profiles

Obviously there is more out there than just water and vegetation. Using NLCD land classes for the area, I extracted the spectral signatures to each land class to identify signatures in each category. Below you can see that water has the lowest reflectance in all 4 bands, while hay/pasture, emergent herbaceuous wetlands, mixed forest, and deciduous forest have relatively high reflectance in longer wavelengths. Band 1 = Blue, Band 2 = Green, Band 3 = Red, Band 4 = NIR.

Principle Components Analysis (PCA)

As one final data exploration, I calculated a PCA to identify fewer, uncorrelated bands from within the larger set of potentially correlated bands. This is sometimes used to transform multi-spectral data to reduce the dimensional and noise of an image. Essentially this process boils down many variables into the principle components, and you can even run predictive models where the PCA levels are treated as the dependent variables, as 95% of the variance usually exists within the first four PCA transformations. Only PCA-1 is shown below.


How about an example: Think about a model examining something in terms of elevation, slope, and aspect. Slope and aspect are derived from elevation and therefore, can both be explained by elevation alone.

Discussion: Lets Make a Map

I thought it would be appropriate to pay homage to why I know about this area in the first place. I tied together the NDVI classification with the NDWI, and overlayed this information with the NAIP image to construct a composite image that better shows the stream channel below Wolford Reservoir, all the way to Kremmling, CO.


It's amazing how much information is portrayed in an image. Some interesting math and analysis can go into making an image appear better cartographically. Of course, I'm more interested in the math and analysis side of things.

Code: RS_ndvi_ndwi_unsupervised_classification.R