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

James Sample j@me@@e@@@mp|e @end|ng |rom gm@||@com
Thu Sep 12 10:55:04 CEST 2019


Thanks Edzer - that's very helpful!

Would it be possible for you to link/share your Ubuntu Dockerfile, please?
(I completely understand if you'd rather not, of course).

Perhaps if I can see how you're setting thing up in Ubuntu I can modify my
Jupyter Dockerfile accordingly, and if I can convince myself that this is a
actually conda-forge/build issue (rather than my own mistake) I can open an
issue on the conda r-rgdal feedstock (
https://github.com/conda-forge/r-rgdal-feedstock).

Thanks again for your help!

Best wishes,


James.



On Wed, 11 Sep 2019 at 23:10, Edzer Pebesma <edzer.pebesma using uni-muenster.de>
wrote:

> On an ubuntu docker image with gdal 3.0.1 and PROJ 6.2.0, I see:
>
> > library(rgdal)
> Loading required package: sp
> rgdal: version: 1.4-6, (SVN revision (unknown))
>  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: FALSE
>  Loaded PROJ.4 runtime: Rel. 6.2.0, September 1st, 2019, [PJ_VERSION: 620]
>  Path to PROJ.4 shared files: (autodetected)
>  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
>
> but also a warning with sf:
>
> > library(sf)
> Linking to GEOS 3.7.2, GDAL 3.0.1, PROJ 6.2.0
> > st_crs("+init=epsg:3035")
> Coordinate Reference System:
>   No EPSG code
>   proj4string: "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
> +ellps=GRS80 +units=m +no_defs"
> Warning message:
> In CPL_crs_from_proj4string(x) :
>   GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return
> a CRS with a non-EPSG compliant axis order.
>
> so it feels like a combination of how PROJ has been installed, and how
> it has been compiled into the R packages.
>
>
> On 9/11/19 9:38 PM, James Sample wrote:
> > 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]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics
> Heisenbergstrasse 2, 48151 Muenster, Germany
> Phone: +49 251 8333081
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list