[R-sig-Geo] rgdal, PROJ6 and "+init=epsg" syntax on Jupyter/conda

James Sample j@me@@e@@@mp|e @end|ng |rom gm@||@com
Wed Sep 11 21:38:30 CEST 2019


Dear all,

I am trying to setup R and rgdal within a JupyterLab environment alongside
my usual Python tools. I realise this is probably an unfamiliar setup for
many, but I hope someone might be able to help nevertheless.

I'm using a Docker container based on Ubuntu 18.04 and derived from the
Jupyter Data Science Notebook (
https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook).
I have Python 3.7 and R 3.6 installed, and I'm using "conda" as my package
manager.

I have successfully installed GDAL and PROJ, together with various Python
and R packages, including 'sp' and 'rgdal'. When I run

    require(rgdal)

I see the following

Loading required package: 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 2.4.2, released 2019/06/28
 Path to GDAL shared files: /opt/conda/share/gdal
 GDAL binary built with GEOS: TRUE
 Loaded PROJ.4 runtime: Rel. 6.1.0, May 15th, 2019, [PJ_VERSION: 610]
 Path to PROJ.4 shared files: (autodetected)
 Linking to sp version: 1.3-1


which seems OK. Most things work as expected, but this

    CRS("+init=epsg:3035")

gives an exception

    Error in CRS("+init=epsg:3035"): no arguments in initialization list

The same code works fine in R-Studio, although I note that my R-Studio
installation has PROJ 4.9.2 (with the same versions of rgdal and sp as
listed above). Unfortunately I can't downgrade PROJ, since some of my
Python packages require version 6.1.

I have read that rgdal is compatible with PROJ6 and I haven't been able to
find (m)any similar issues online, so I assume I'm doing something wrong.
As a workaround, this runs successfully

showP4(showWKT("+init=epsg:3035"))

But the original syntax is cleaner and I'd rather not refactor all my old
code if I can help it. Can anyone point me in the right direction, please?
Is the "+init=epsg" syntax supported with PROJ 6, or should I be using an
alternative?

Thanks and best wishes,


James.

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list