getCRS: Methods to get the proj4 string

getCRS-methodsR Documentation

Methods to get the proj4 string

Description

Gets the proj4 string from a object of type "Spatial" or "Raster".

Usage

## S4 method for signature 'Spatial'
getCRS(obj)
## S4 method for signature 'Raster'
getCRS(obj) 

Arguments

obj

object of type "Spatial" or "Raster"

Details

For more details about the PROJ.4 parameters refer to the https://proj4.org.

Author(s)

Tomislav Hengl and Pierre Roudier

See Also

sp::CRS, raster::raster, check_projection

Examples

data(eberg_grid)
library(sp)
coordinates(eberg_grid) <- ~x+y
gridded(eberg_grid) <- TRUE
library(rgdal)
proj4string(eberg_grid) <- CRS("+init=epsg:31467")
library(raster)
r <- raster(eberg_grid[1])
getCRS(r)
r.ll <- reproject(r)
getCRS(r.ll)

Envirometrix/plotKML documentation built on June 13, 2022, 11:21 p.m.