Skip to content

no proj_defs.dat file in PROJ.4 files message when using rgdal

5 messages · Roger Bivand, Wall, Wade A ERDC-RDE-CERL-IL CIV

#
Hi all,

I am using R on a high performance Linux cluster and had to build gdal, proj4 (version 4.9.2), and rgdal from source. I had to install proj.4 in a non-standard location (/p/bin/proj4) and this appears to be causing some problems.

I modified my $PATH variable to include /p/bin/proj4; /p/bin/proj4/lib;/p/bin/proj4/share/proj

I installed rgdal using the following command

Install.packages("rgdal",configure.args = c("--with-project-include=/p/bin/proj4/include","--with-proj-lib=/p/bin/proj4/lib","--with-proj-share=/p/bin/proj4/share/proj"))

When I load rgdal, the path to gdal is displayed, but the path to proj4 says "(autodetected)". 

However, I receive the message "rgdal::checkCRSArgs:: no proj_defs.dat in PROJ.4 shared files" when I try to use the raster() function from the raster package.

I have verified that proj_def.dat is in /p/bin/proj4/share/proj. I have also tried placing it in other locations.

Any suggestions on how  I can get rgdal to find the proj_def.dat file(s)?  

Wade
#
On Fri, 12 Aug 2016, Wall, Wade A ERDC-RDE-CERL-IL CIV wrote:

            
No, not $PATH for anything other than executables. You may need a 
different path for the shared objects. For the PROJ shared files, set 
PROJ_LIB, which should be respected.

Roger

  
    
#
Thanks. PROJ_LIB now provides the link and when I load rgdal, the path to the PROJ.4 shared files is recognized. However, I still receive the warning: No proj_defs.dat in PROJ.4 shared files.

I edited my .bashrc  with PROJ_LIB=/p/bin/proj4/share/proj. This folder contains proj_defs.dat, as well as a duplicate file called proj_def.dat because I have seen the file named both ways.

I also changed PROJ_LIB to /p/bin/proj4/share and copied proj_defs.dat to that location. Still not sure how to get rgdal to recognize the prof_defs.dat file

-----Original Message-----
From: Roger Bivand [mailto:Roger.Bivand at nhh.no] 
Sent: Friday, August 12, 2016 9:15 AM
To: Wall, Wade A ERDC-RDE-CERL-IL CIV <Wade.A.Wall at erdc.dren.mil>
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] no proj_defs.dat file in PROJ.4 files message when using rgdal
On Fri, 12 Aug 2016, Wall, Wade A ERDC-RDE-CERL-IL CIV wrote:

            
No, not $PATH for anything other than executables. You may need a different path for the shared objects. For the PROJ shared files, set PROJ_LIB, which should be respected.

Roger
--
Roger Bivand
Department of Economics, Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no
Blockedhttp://orcid.org/0000-0003-2392-6140Blocked
Blockedhttps://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=enBlocked
Blockedhttp://depsy.org/person/434412Blocked
#
On Fri, 12 Aug 2016, Wall, Wade A ERDC-RDE-CERL-IL CIV wrote:

            
Are you exporting the local PROJ_LIB definition to other nodes in your 
cluster? Can all R instances see the definition:

Sys.getenv("PROJ_LIB")

across your systems?

Roger

  
    
#
Currenty, I am only running the script at the login node.

When I type Sys.getenv("PROJ_LIB"), it returns the path to the shared directory. I made a mistake and had two paths in $PROJ_LIB, one to /share and the other to /share/proj. Both directories had the proj_defs.dat file. I removed /share from $PROJ_LIB and everything seems to be working now.

Thanks again for your help. 

Wade 


-----Original Message-----
From: Roger Bivand [mailto:Roger.Bivand at nhh.no] 
Sent: Friday, August 12, 2016 11:31 AM
To: Wall, Wade A ERDC-RDE-CERL-IL CIV
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] no proj_defs.dat file in PROJ.4 files message when using rgdal
On Fri, 12 Aug 2016, Wall, Wade A ERDC-RDE-CERL-IL CIV wrote:

            
Are you exporting the local PROJ_LIB definition to other nodes in your cluster? Can all R instances see the definition:

Sys.getenv("PROJ_LIB")

across your systems?

Roger
--
Roger Bivand
Department of Economics, Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no
Blockedhttp://orcid.org/0000-0003-2392-6140Blocked
Blockedhttps://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=enBlocked
Blockedhttp://depsy.org/person/434412Blocked