Closed JamesSample closed 5 years ago
I don't think this is related to the proj version. It seems to be related to the environment variable for the $PROJ_LIB
environment variable. Here is what I get if I installed this in an env and activate:
> library(rgdal)
Loading required package: sp
rgdal: version: 1.4-4, (SVN revision 833)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.0.1, released 2019/06/28
Path to GDAL shared files:
GDAL binary built with GEOS: TRUE
Loaded PROJ.4 runtime: Rel. 6.1.1, July 1st, 2019, [PJ_VERSION: 611]
Path to PROJ.4 shared files: ~/miniconda3/envs/TEST/share/proj
Linking to sp version: 1.3-1
> CRS("+init=epsg:3035")
CRS arguments:
+init=epsg:3035 +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000
+y_0=3210000 +ellps=GRS80 +units=m +no_defs
Note that I have the right path Path to PROJ.4 shared files: ~/miniconda3/envs/TEST/share/proj
instead of (autodetected)
.
Are you installing things in the base environment? Can you try to activate it before calling jupyterlab? (conda activate base
or source activate base
).
I'm closing this b/c it is not really a problem with the package but conda's use with a Docker image. We can still discuss things here but ultimately it is a conda "expected" behavior to have things installed in an env and activate that env.
Thanks for such a fast and helpful response!
You're absolutely right - this is a path/environment variable problem. When I saw Path to PROJ.4 shared files: (autodetected)
I assumed everything was OK, but explicitly setting the path to the proj
folder has solved the problem :-)
I am installing everything within my base
environment, since this Dockerfile will only ever be used with a single env deployed via JupyterHub. The environment is configured in the Jupyter "base notebook" Dockerfile here and to get things working I had to fix the PROJ_LIB
environment variable in my Dockerfile, as follows:
ENV PROJ_LIB $CONDA_DIR/share/proj
Thanks once again for your help on this! I was heading in completely the wrong direction thinking this was something to do with PROJ6/PROJ4 "emulation mode".
I actually had this issue somewhere else and I did not post my solutions here b/c they were all bad. I'm copying your solution now :smile: win-win
Thanks!
I am trying to setup r-rgdal within a JupyterLab environment using a Docker container based on Ubuntu 18.04 and derived from the Jupyter Data Science Notebook Docker stack.
The following minimal Dockerfile reproduces my issue, although my "real" Dockerfile is a bit more complicated.
This builds without errors and I can start JupyterLab using
If I then create an R notebook and run
library(rgdal)
, I see the following, which looks OKHowever, if I try
CRS("+init=epsg:3035")
I get the following errorThe same code works fine using rgdal installed locally via R-Studio. I've also asked on the r-sig-geo mailing list and it appears that this should work with recent versions of rgdal and PROJ version 6 (see the discussion here for further details).
I realise there are various issues for both Python and R relating to API changes in PROJ6, but I think
CRS("+init=epsg:3035")
should still work (?).Does anyone have any suggestions, please? I'm currently unsure whether:
Thanks in advance for any suggestions! :-)
Environment (
conda list
):Details about
conda
and system (conda info
):