#Liberal Model #High elevation is good #Low slope is good #Close to airports is good #Close to interstates is good elev_min <- as.vector( global(elev, fun=min, na.rm= TRUE)) elev_max <- as.vector( global(elev, fun=max, na.rm= TRUE)) elev_score <- ((elev - elev_min) /(elev_max - elev_min)) ele_s <- tm_shape(elev_score) + tm_raster( style= "cont") + tm_layout( main.title= "Elevation") slp_min <- as.vector( global(slp, fun=min, na.rm= TRUE)) slp_max <- as.vector( global(slp, fun=max, na.rm= TRUE)) slp_score <- 1 - ((slp - slp_min) /(slp_max - slp_min)) slp_s <- tm_shape(slp_score) + tm_raster( style= "cont") + tm_layout( main.title= "Slope") air_min <- as.vector( global(dist, fun=min, na.rm= TRUE)) air_max <- as.vector( global(dist, fun=max, na.rm= TRUE)) air_score <- 1 - ((dist - air_min) /(air_max - air_min)) airport_s <- tm_shape(air_score) + tm_raster( style= "cont") + tm_layout( main.title= "Airports") inter_min <- as.vector( global(dist2, fun=min, na.rm= TRUE)) inter_max <- as.vector( global(dist2, fun=max, na.rm= TRUE)) inter_score <- 1 - (dist2 - inter_min) /(inter_max - inter_min) interstate_s <- tm_shape(inter_score) + tm_raster( style= "cont") + tm_layout( main. The link at the bottom of the page provides the example data and R Markdown file used to generate this module. The documentation for this package is available here. SpatExtent: for spatial extent information derived from a SpatRaster or SpatVector or manually defined.Īlthough we will not explore it directly here, the stars package offers additional functionality to efficient work with spatial data including spatiotemporal arrays, raster data cubes, and vector data cubes.SpatVector: represent vector-based point, line, or polygon features and their associated attributes.SpatRaster: for raster data and limits memory usage in comparison to the raster package data models.The terra package introduces the following new classes: Here are some helpful links for learning terra: In order to investigate terra, we will re-execute some of the processes explored in prior modules using terra as opposed to raster with a focus on highlighting differences in the syntax and implementation. Eventually, I plan to remove our raster package content and maintain only the terra content. that state to create a symbol as a raster or vector symbol instance. However, it is important to introduce terra. Heart Symbol - copy love emoji Copy paste, or type heart text. Since terra is fairly new, I have decided to maintain the material relating to the raster package for the time being. It also supports working with larger data sets as it is not required to read entire raster grids into memory. Copy Link Version Install install. This package has been superseded by the 'terra' package. First, it is very fast since it makes use of C++ code. Description Reading, writing, manipulating, analyzing and modeling of spatial data. terra works to alleviate some of these issues. The raster package can be slow and can result in memory issues if large raster data sets are used. However, recently the originators of raster have released the terra package, which has been designed to replace raster. The raster package has been a central tool for working with geospatial data in R.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |