NLCD land cover by area for each county in MO odd numbered years 2001-2023.
Source:R/data.R
nlcd.area.tab.Rd
A dataset derived of Annual NLCD data- files were obtained via the FedData package (NLCD) and tigir package (county boundaries). NLCD data was reprojected to NAD83 UTM 15 N before areal calculations.
Format
- cty
county name
- yr
4 digit year
- crop.sqkm
area in km^2 of crop
- develop.sqkm
area in km^2 of developed
- forest.sqkm
area in km^2 of forest
- grass.sqkm
area in km^2 of grass
- water.sqkm
area in km^2 of water
- wetland.sqkm
area in km^2 of wetland
- other.sqkm
area in km^2 of all other landcover types present
Details
See vignettes for examples on how to batch process
Cropping performed with terra::crop and the terra:mask
Area converted to square km based on a 30x30m cell size and summing all all pixels with in a given class. No other processing occurred.
Examples
if (FALSE) { # \dontrun{
#data processed as follows:
# list projected NLCD files in a folder
list.nlcd<-list.files(path='./prj_NLCD/',
pattern='.tif$',
full.names=TRUE)
MDCSpatialData::counties.mo->co
co%>%split(.$NAME)%>%
map(.,~terra::vect(.x))->tmp
nlcd.fxn<-function(nlcd,
county,year){
terra::rast(nlcd)->Z
mo.co.list[[county]]->Q
terra::crop(Z,Q)->P
terra::mask(P,Q)%>%
terra::freq()%>%
rename(LC=value)%>%
select(LC,count)%>%
group_by(LC)%>%
summarize(n.cells=sum(count))%>%
ungroup()%>%
mutate(pct.area=n.cells/sum(n.cells),
area.sqkm=(n.cells*(30*30)/1E6),
cty=county,
yr=year)
}
crossing(list.nlcd,names(mo.co.list))%>%
rename(path=1,
county=2)%>%
mutate(year=str_extract(path,pattern='20\\d{2}'))%>%
pmap(~nlcd.fxn(..1,..2,..3))->nlcd.tab
bind_rows(nlcd.tab)%>%
select(-n.cells,-pct.area)%>%
mutate(LC=paste0(LC,'.sqkm'))%>%
pivot_wider(names_from=LC,
values_from=area.sqkm)->nlcd.area.tab
} # }