spatial.tools (version 1.6.0)

fix_extent: Forces a list of Raster*s to all have the same extent.

Description

Forces a list of Raster*s to all have the same extent.

Usage

fix_extent(extent_reference, broken_extents)

Arguments

extent_reference

Raster*. A Raster* object that will provide the extent to all the other Raster*s. If unassigned, will assume it is the first Raster* in the broken_extents list.

broken_extents

list of Raster* objects. Raster* objects that will be coerced to the extent_reference's extent.

See Also

extent,stack

Examples

Run this code
# NOT RUN {
library("raster")
tahoe_highrez <- brick(system.file("external/tahoe_highrez.tif", package="spatial.tools"))
tahoe_highrez
tahoe_highrez_broken <- tahoe_highrez
# We'll "break" the extent:
extent(tahoe_highrez_broken) <- c(0,360,-90,90)
tahoe_highrez_broken
tahoe_highrez_fixed <- fix_extent(tahoe_highrez,tahoe_highrez_broken)
tahoe_highrez_fixed

# }

Run the code above in your browser using DataCamp Workspace