Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized CRS in RStudio #111

Open
tylerdrudolph opened this issue Nov 8, 2021 · 4 comments
Open

Unrecognized CRS in RStudio #111

tylerdrudolph opened this issue Nov 8, 2021 · 4 comments

Comments

@tylerdrudolph
Copy link

Invoking certain legitimate EPSG codes draws errors on my machine, seemingly only in RStudio but occasionally in Rterm as well:

# RStudio console
> sp::CRS("EPSG:3005")
Error in sp::CRS("EPSG:3005") : NA

# RStudio terminal
> sp::CRS("EPSG:3005")
CRS arguments:
+proj=aea +lat_0=45 +lon_0=-126 +lat_1=50 +lat_2=58.5 +x_0=1000000
+y_0=0 +datum=NAD83 +units=m +no_defs

R and packages are up-to-date and I am testing in a clean environment:

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252    LC_MONETARY=English_Canada.1252 LC_NUMERIC=C                   
[5] LC_TIME=English_Canada.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.2  rgdal_1.5-27    tools_4.1.2     sp_1.4-5        grid_4.1.2      lattice_0.20-45

See rspatial/raster#232 and rstudio/rstudio#10052 for background.
Is this an sp or an RStudio problem?

@kevinushey
Copy link

Can you also share the output of traceback() after the error occurs? It might help pinpoint which function call is failing underneath the hood.

@tylerdrudolph
Copy link
Author

By all means @kevinushey.

> traceback()
2: stop(res[[2]])
1: sp::CRS("EPSG:3005")

@KarHarker
Copy link

Any luck figuring this out @tylerdrudolph? Having the same problem

@tylerdrudolph
Copy link
Author

@KarHarker As of today, all my packages are up-to-date, yet the issue persists. My solution is to progressively rework all active code such that it no longer references CRS(), instead using sf::st_crs(), and the terra package in lieu of raster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants