![]() When reclassifying a continuous grid, a ranges of values will be recoded or binned to a new value. Reclassify is used to change or recode cell values in a grid. The cell size can be checked by calling the resulting object. The new cells will be populated with the mean from the original cells that fall within them. So, the 30 m grid is converted to a 150 m grid. In the example, I have used the aggregate() function to increase the cell size by a factor of 5. Nearest neighbor is also appropriate for categorical data since no averaging is applied. Instead, you would want to use maximum, minimum, or majority. For example, taking the average or using bilinear interpolation would not be appropriate for a categorical grid since you can’t average categories. When resampling cells, make sure to use a method appropriate for the input raster data type. disaggregate(): make cell size smaller by a defined factor.aggregate(): increase the cell size by a defined factor and calculate a statistic from the smaller, original cells to populate the larger, new cells.resample(): change cell size using bilinear interpolation (inverse distance weighted average of nearest 4 cell values) or nearest neighbor (only considers nearest cell value).The raster package provides three different functions to accomplish this. It is also possible to change the cell size of a grid. I recommend reviewing your data prior to any analyses. I also map the DEM to check that it has loaded correctly. All raster data are in TIFF format while all vector data are stored as shapefiles. The vector data are being read using st_read() from the sf package. str: man-made structures mapped as points for portion of the stateĪll raster grids are being read using the raster() function from the raster package, as they are all single-band rasters.ws: watershed boundaries for subset of the state.lc: 30 m resolution categorical land cover grid from the 2011 National Land Cover Database (NLCD).slp: slope in degrees derived from the elevation raster grid.elev: 30 m resolution digital elevation model ( DEM) in meters from the National Elevation Dataset (NED).In this section, we will work with data from West Virginia. Library(sf) library(rgdal) library(raster) library(tmap) library(tmaptools) library(spatialEco) library(RStoolbox)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |