setWindow: Set the reference window of a spatial object.

Description Usage Arguments Details Value See Also Examples

Description

Set the reference window of a spatial object.

Usage

1
2
3
4
5
6
7
setWindow(x, to, ...)

## S4 method for signature 'ANY'
setWindow(x)

## S4 method for signature 'geom'
setWindow(x, to = NULL)

Arguments

x

the object for which to set a new reference window.

to

any suitable data-structure that contains the minimum and maximum values in x and y-dimension to which the reference window shall be set, see Details.

...

other arguments.

Details

Possible data-structures are

Value

The object x with an update reference window.

See Also

Other setters: setCRS(), setFeatures(), setGroups(), setHistory()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# create a polygon programmatically
coords <- data.frame(x = c(40, 70, 70, 50),
                     y = c(40, 40, 60, 70))
(aGeom <- gs_polygon(anchor = coords))
visualise(aGeom)

window <- data.frame(x = c(0, 80),
                     y = c(0, 80))
(aGeom <- setWindow(x = aGeom, to = window))

visualise(aGeom)

geometr documentation built on Sept. 21, 2021, 1:07 a.m.