2

I am encountering an issue related to assigning CRS in sp package

If I run:

sp::CRS(SRS_string='EPSG:4326')

sp::CRS("+init=epsg:4326")

I get respectively those two errors:

Error in sp::CRS(SRS_string = "EPSG:4326") : NA

Error in sp::CRS("+init=epsg:4326") : NA

I checked whether rgdal uses the minimal PROJ/GDAL versions:

rgdal::rgdal_extSoftVersion()

GDAL GDAL_with_GEOS           PROJ             sp 

"3.2.1"         "TRUE"        "7.2.1"        "1.4-5"

And it also works if I use proj4string format to the CRS() function:

CRS("+proj=utm +zone=47 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs")

But there is a warning message in proj4string format:

Warning message:

In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) : Discarded datum unknown in Proj4 definition

I have uninstalled R and RStudio with all packages, settings, and everything else using this guideline: How to uninstall R and RStudio with all packages, settings and everything else? , but the problem is not being solved when I reinstalled R,Rstudio as well ass the needed pacakges.

Vinícius Félix
  • 8,448
  • 6
  • 16
  • 32
Mukhtar Abdi
  • 391
  • 1
  • 12
  • in my case a reinstallation of rdgal with ```install.packages("rgdal", repos="http://R-Forge.R-project.org")``` and setting ```rgdal::set_proj_search_paths("C:/Users/Christof/Documents/R/win-library/4.1/rgdal/proj")``` as described here https://github.com/jhollist/elevatr/issues/48#issuecomment-1059802332 had fixed the same problem – ckluss Mar 18 '22 at 17:28

0 Answers0