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

Work around for rnaturalearth package crashing in Linux #34

Open
John-R-Wallace-NOAA opened this issue Oct 21, 2020 · 8 comments
Open

Comments

@John-R-Wallace-NOAA
Copy link

Using:

  rnaturalearth::ne_countries(..., returnclass = "sf")  

in plot_westcoast() crashes Linux, so I created the 'world' data in R under Win 10 and loaded that into Linux.

Then I got this error:

  R GDAL Error 1: No PROJ.4 translation for source SRS, coordinate transformation initialization has failed.

The solution to this error is to set the coordinate reference system while in Linux:

 sf::st_crs(world) = 4326

The coordinate reference system solution is here:

 https://github.com/r-spatial/sf/issues/1386

I created the 'Linux' branch with an option in plot_westcoast() to load 'world_hires.RData' from the package's 'Data' folder when not running under Windows and to set the coordinate reference system. There is no change when running under Windows.

If using a Linux server with R-MKL don't forget to limit the number of threads to a reasonable number using:

 blas_set_num_threads(6)
 blas_get_num_procs()
@kellijohnson-NOAA
Copy link
Contributor

@John-R-Wallace-NOAA sorry VASTWestCoast is not working on tantalus. Did you try to debug the installation of rnaturalearth first before making a work around? I am getting the packages from CRAN and it might be that we just need to get them using a remote in the description file that points to github. I say this because others are successfully using the package on linux, see here.

@John-R-Wallace-NOAA
Copy link
Author

John-R-Wallace-NOAA commented Oct 30, 2020 via email

@kellijohnson-NOAA
Copy link
Contributor

I just linked the issue b/c they were using linux, not because it was the exact same problem. But the output that you provided is really helpful. Thank you. Do you think that this should be reported to the package authors so that they know there is an issue, or maybe it is something that we can solve?

@John-R-Wallace-NOAA
Copy link
Author

John-R-Wallace-NOAA commented Oct 30, 2020

Seems it's up to them to fix, if they can.

I made an issue.

@kellijohnson-NOAA
Copy link
Contributor

I am not certain why this is an issue on the linux server when this example / question indicates that the same call on their linux computer ran just fine. @John-R-Wallace-NOAA do you think that it has to do with R version 4.0? I would like to find an actual fix to this using the rnaturalearth package b/c VAST itself uses this package. So any work around means that VAST plotting functions would not work, which seems poor practice on our part.

@John-R-Wallace-NOAA
Copy link
Author

John-R-Wallace-NOAA commented Nov 5, 2020 via email

@kellijohnson-NOAA
Copy link
Contributor

@John-R-Wallace-NOAA perhaps this issue about sf and geos will be helpful. I would much rather fix the installation for required packages rather than have multiple threads of code to maintain.

@John-R-Wallace-NOAA
Copy link
Author

John-R-Wallace-NOAA commented Nov 7, 2020 via email

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

2 participants