The dimensions of the stacked image is 7811 by 7681, the crs is WGS84, and the resolution is 30 by 30.
The dimensions of the cropped image is 340 by 346, the crs is WGS84, and the resolution is still 30 by 30.
## [1] "R-G-B (natural color)"
## [1] "NIR-R-G(fa) (color infrared)"
## [1] "NIR-SWIR1-R (false color water focus)"
plotRGB(r, r = 4, g = 3, b = 2, stretch = "hist")
print("R-G-B (natural color)")
## [1] "R-G-B (natural color)"
plotRGB(r, r = 5, g = 4, b = 3, stretch = "lin")
print("NIR-R-G(fa) (color infrared)")
## [1] "NIR-R-G(fa) (color infrared)"
plotRGB(r, r = 5, g = 6, b = 4, stretch = "lin")
print("NIR-SWIR1-R (false color water focus)")
## [1] "NIR-SWIR1-R (false color water focus)"
plotRGB(r, r = 7, g = 6, b = 4, stretch = "hist")
The stretch function increases the range of pixel brightness values, which increases the color range and contrast of the image.
These images show different ways of representing the flood data. The maps are similar in that they all visually separate the surface water data from other land forms, but differ in how the surface water and surrounding area appear visually. The NDVI threshold makes it easy to visualize photosynthetic activity, and so brings out vegetation and agricultural land. NDWI, MNDWI, WRI, and SWI all enhance surface water data, but use different threshold formulas. NDWI uses the green and NIR bands in its formula, and so agricultural areas in the land still appear different from other land. MNDWI, WRI, and SWI, however, all use the SWIR1 band in their formulas which creates a more defined separation between all dry land and water.
## Using K-Means Algorithm to Group Raster Cells
## [1] 117640 6
In terms of the dimensions of the extracted values, there are 117,640 rows and 6 columns, one column for each different band of the raster stack. This shows that the data was extracted cell-by-cell for each of the methods as there are 6,705,840 points (117,640 cells for each method).
Number | |
---|---|
NDVI | 6666 |
NDWI | 7212 |
MNDWI | 11939 |
WRI | 8469 |
SWI | 15207 |
K.Means | 9074 |
Since we know that each cell has a resolution of 30 meters by 30 meters, each cell has an area of 900 meters squared. We then multiply 900 by the number of cells to get the total flooded area in each image.
Area | |
---|---|
NDVI | 5999400 |
NDWI | 6490800 |
MNDWI | 10745100 |
WRI | 7622100 |
SWI | 13686300 |
K.Means | 8166600 |
## [1] "Lng = -91.78959, Lat = 42.06305"
## NDVI NDWI MNDWI WRI SWI K.Means
## [1,] 1 1 1 1 1 1
As you can see below, in each of the layers, the value at this point is 1 which means that all of the layers capture flooding at this specific location.