Transform or convert coordinates of simple features directly with Proj.4 (bypassing GDAL)
Transform or convert coordinates of simple features directly with Proj.4 (bypassing GDAL)
st_transform_proj(x, crs,...)## S3 method for class 'sfc'st_transform_proj(x, crs,...)## S3 method for class 'sf'st_transform_proj(x, crs,...)## S3 method for class 'sfg'st_transform_proj(x, crs,...)
Arguments
x: object of class sf, sfc or sfg
crs: character; target CRS, or, in case of a length 2 character vector, source and target CRS
...: ignored
Details
Transforms coordinates of object to new projection, using PROJ directly rather than the GDAL API used by st_transform .
If crs is a single CRS, it forms the target CRS, and in that case the source CRS is obtained as st_crs(x). Since this presumes that the source CRS is accepted by GDAL (which is not always the case), a second option is to specify the source and target CRS as two proj4strings in argument crs. In the latter case, st_crs(x) is ignored and may well be NA.
The st_transform_proj method for sfg objects assumes that the CRS of the object is available as an attribute of that name.