![]() Here we will provide the ext()įunction our xmin, xmax, ymin, and ymax (in that order). Alternatively, we can also the ext() function toĭefine an extent to be used as a cropping boundary. So far, we have used a vector layer to crop the extent of a rasterĭataset. Vegetation plot layer will still extend further west than the extent of The crop()įunction will make a raster extent smaller, it will not expand theĮxtent in areas where there are no data. Notice that the extentįor our vegetation plot layer (black) extends further west than theĮxtent of our CHM raster (bright green). The relative extents of all the spatial objects. One is situated on the blank space to the left of theĪ modification of the first figure in this episode is below, showing Locations (black dots) appear on the Canopy Height Model raster layerĮxcept for one. In the plot above, created in the challenge, all the vegetation plot R CHM_plots_HARVcrop <- crop (x = CHM_HARV, y = plot_locations_sp_HARV ) CHM_plots_HARVcrop_df <- as.ame ( CHM_plots_HARVcrop, xy = TRUE ) ggplot ( ) + geom_raster (data = CHM_plots_HARVcrop_df, aes (x = x, y = y, fill = HARV_chmCrop ) ) + scale_fill_gradientn (name = "Canopy Height", colors = lors ( 10 ) ) + geom_sf (data = plot_locations_sp_HARV ) + coord_sf ( ) The boundaries of the AOI will be colored blue, and we use Let’s start by plotting theįull extent of the CHM data and overlay where the AOI falls within it. To illustrate this, we will crop the Canopy Height Model (CHM) to R will use the extent of the spatial object as Raster to be cropped and the spatial object that will be used to crop We can use the crop() function to crop a raster to theĮxtent of another spatial object. When creating pretty maps so that the raster layer matches the extent of It is often moreĮfficient to crop the raster to the extent of our study area to reduceįile sizes as we process our data. Larger than our study area or area of interest. Sometimes we have a raster file that is much A canopy height model (CHM) in GeoTIFF format – greenįrequent use cases of cropping a raster file include reducing file.Vegetation plot locations (marked with white dots)– black.Layers that we have worked with in this workshop: The graphic below illustrates the extent of several of the spatial Thus it represents the overall geographic coverage Represents the geographic “edge” or location that is the furthest north, ![]() The spatial extent of a vector layer or R spatial object We often work with spatial layers that have different spatialĮxtents. ![]() That occur within a set of polygons, or in a buffer (surrounding) regionĪround a set of points. We will also cover how to extract values from a raster This episode explains how to crop a raster using the extent of a See the lesson homepage for detailed informationĪbout the software, data, and other prerequisites you will need to work
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |