Skip to contents

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.

Usage

nlcd.pct.tab

Format

cty

county name

yr

4 digit year

crop.pct

percent area of crop

develop.pct

percent area of developed

forest.pct

percent area of forest

grass.pct

percent area of grass

water.pct

percent area of water

wetland.pct

percent area of wetland

other.pct

percent area of all other landcover types present

Details

Cropping performed with terra::crop

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,-area.sqkm)%>%
   mutate(LC=paste0(LC,'.pct'))%>%
   pivot_wider(names_from=LC,
               values_from=pct.area)->nlcd.pct.tab

                   } # }