[R-sig-Geo] rgdal warning

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Fri Jun 7 11:10:10 CEST 2019


On Wed, 5 Jun 2019, Panasci, Michael wrote:

>
> My question is in regards to the Implications of the 
> "rgdal::checkCRSArgs:: no proj_defs.dat in PROJ.4 shared files" warning. 
> I recently solved this problem on a high-performance Linux cluster by 
> redefining the PROJ_LIB path with:
>
> export PROJ_LIB=/opt/ohpc/pub/libs/intel/proj/5.0.1/share/proj

In the 4.9.1 release of PROJ (March 2015), the proj_defs.dat file was left 
out by accident. A work-around was added to rgdal then. This only affects 
people using really old systems with very out-of-date PROJ and GDAL 
versions (or possibly trying to reproduce old work).

>
> I generated lots of data before finding this fix.  Despite receiving the 
> warning message, does this actually lead to erroneous data?  All of my 
> projection components were appropriately defined and the code seemed to 
> have run fine (based on looking at the results).  Now that the issue is 
> resolved and I no longer receive the warning, I'm wondering if I need to 
> regenerate all the data from before realizing this fix.  I have not been 
> able to find anything definitive on this message board regarding 
> implications of that error.  Thoughts?

The fix (still operative for those affected is:

proj_def_bug_fix <- function(uprojargs) {
     if (length(grep("no_defs", uprojargs)) == 0L &&
# corrected 20150904
         length(grep("init", uprojargs)) == 0L) {
         if (length(grep("ellps", uprojargs)) == 0L &&
# corrected 20150905
             length(grep("datum", uprojargs)) == 0L) {
             tags <- sapply(strsplit(strsplit("+proj=longlat +no_defs",
                 "\\+")[[1]], "="), "[", 1)
# based on proj/src/pj_init.c lines 191-197
             if (!any(c("datum", "ellps", "a", "b", "rf", "f") %in% tags)) 
{
                 uprojargs <- paste(uprojargs, "+ellps=WGS84", sep=" ")
            }
          }
     }
     uprojargs
}

run by rgdal::checkCRSArgs() when no proj_defs.dat is found. The missing 
file added +ellps=WGS84 to proj strings with no ellipse or datum 
information. If your input strings defined "+ellps=" and/or "+datum=" (or 
the other "a", "b", "rf", "f" values) no action was taken. The problem was 
noted in https://stat.ethz.ch/pipermail/r-sig-geo/2015-June/022969.html 
and the first changes in rgdal came in 0.9-3 2015-05-21. The advice then 
given was: "The best remedy is to update rgdal to >= 0.9-3 or put a copy 
of the missing file in the appropriate place."

You seem to have multiple versions of PROJ installed, which always risks 
trouble. If you have to run 4.9.1, add the missing file to the appropriate 
directory (possibly ../share/proj for the version you are using), then the 
warnings go away.

Roger

>
> Michael
>
> 	[[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
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en



More information about the R-sig-Geo mailing list