Skip to content

Unrecognized CRS in RStudio #111

Open

Description

@tylerdrudolph

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?

Activity

  1. kevinushey commented on Nov 8, 2021

    @kevinushey

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

  2. tylerdrudolph commented on Nov 8, 2021

    @tylerdrudolph
    Author

    By all means @kevinushey.

    > traceback()
    2: stop(res[[2]])
    1: sp::CRS("EPSG:3005")
    
  3. KarHarker commented on Dec 17, 2021

    @KarHarker

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

  4. tylerdrudolph commented on Dec 20, 2021

    @tylerdrudolph
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions