Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setCRS

Set (or transform) the coordinate reference system of a spatial object.


Description

Set (or transform) the coordinate reference system of a spatial object.

Usage

setCRS(x, crs, ...)

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

## S4 method for signature 'geom'
setCRS(x, crs = NULL)

## S4 method for signature 'Spatial'
setCRS(x, crs = NULL)

## S4 method for signature 'sf'
setCRS(x, crs = NULL)

## S4 method for signature 'Raster'
setCRS(x, crs = NULL)

Arguments

x

the object for which to set the coordinate reference system.

crs

[character(1)]
the coordinate reference system to set for this object.

...

other arguments.

Details

In case an object does not yet have a coordinate reference system assigned, this function simply assigns it. In case the object has already a valid crs, a transformation to the new crs will be carried out. The transformation is computed for all classes with the standard defined in the rgdal package.

Value

The object x with an assigned or transformed coordinate reference system.

See Also

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


geometr

Generate and Modify Interoperable Geometric Shapes

v0.2.10
GPL-3
Authors
Steffen Ehrmann [aut, cre] (<https://orcid.org/0000-0002-2958-0796>), Dan Sunday [cph] (fast point-in-polygon algorithm.)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.