To demonstrate rasterization in action, we will use a template raster that has the same extent and CRS as the input vector data cycle_hire_osm_projected (a dataset on cycle hire points in London is illustrated in Figure 6.5(A)) and spatial resolution of 1000 meters: Often the target resolution is imposed on the user, for example when the output of rasterization needs to be aligned to the existing raster. There are no simple rules to follow when deciding an appropriate geographic resolution, which is heavily dependent on the intended use of the results. The geographic resolution of the input raster has a major impact on the results: if it is too low (cell size is too large), the result may miss the full geographic variability of the vector data if it is too high, computational times may be excessive. Its first two arguments are, x, vector object to be rasterized and, y, a ‘template raster’ object defining the extent, resolution and CRS of the output. The terra package contains the function rasterize() for doing this work. Usually, the output raster is used for quantitative analysis (e.g., analysis of terrain) or modeling.Īs we saw in Chapter 2 the raster data model has some characteristics that make it conducive to certain methods.įurthermore, the process of rasterization can help simplify datasets because the resulting values all have the same spatial resolution: rasterization can be seen as a special type of geographic data aggregation. Rasterization is the conversion of vector objects into their representation in raster objects. The following code chunk therefore not only reads the datasets from the spDataLarge package installed in Chapter 2, it also ‘reprojects’ zion (a topic covered in Chapter 7): A vector ( sf) object zion representing Zion National Parkīoth target and cropping objects must have the same projection.A SpatRaster object srtm representing elevation (meters above sea level) in south-western Utah. ![]() We will use two objects to illustrate raster cropping: ![]() In this case raster cropping and masking are useful for unifying the spatial extent of input data.īoth operations reduce object memory use and associated computational resources for subsequent analysis steps, and may be a necessary preprocessing step before creating attractive maps involving raster data. Often the extent of input raster datasets is larger than the area of interest. ![]() Many geographic data projects involve integrating data from many different sources, such as remote sensing images (rasters) and administrative boundaries (vectors).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |