The extent of an area that encompasses an object, which is at least the objects extent, or larger.

getWindow(x, ...)

# S4 method for ANY
getWindow(x)

# S4 method for geom
getWindow(x)

# S4 method for Spatial
getWindow(x)

# S4 method for sf
getWindow(x)

# S4 method for Raster
getWindow(x)

# S4 method for SpatRaster
getWindow(x)

# S4 method for matrix
getWindow(x)

Arguments

x

the object from which to derive the reference window.

...

other arguments.

Value

A tibble of the corner coordinates of the reference window of x. This table has two columns (x and y) and two rows (minimum and maximum).

Details

Calling getWindow on spatial classes that do not have a window attribute returns the same value as getExtent.

See also

Examples


getWindow(gtGeoms$line)
#> # A tibble: 2 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1   -50   -50
#> 2    50    50

gc_sp(gtGeoms$line) %>%
  getWindow()
#> # A tibble: 2 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1 -34.6   -40
#> 2  34.6    40

gc_sf(gtGeoms$line) %>%
  getWindow()
#> # A tibble: 2 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1 -34.6   -40
#> 2  34.6    40

gc_raster(gtGeoms$grid$categorical) %>%
  getWindow()
#> # A tibble: 2 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1     0     0
#> 2    60    56

gc_terra(gtGeoms$grid$categorical) %>%
  getWindow()
#> # A tibble: 2 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1     0     0
#> 2    60    56

getWindow(x = matrix(0, 3, 5))
#> # A tibble: 2 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1     0     0
#> 2     5     3