4

I am brand new to using geographic data in R and I keep running into an error:

NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

I believe that this is due to an old version of PROJ (4.9.0), and I have found a good deal of discussion surrounding this topic but I have been unsuccessful in fixing this issue - mostly due to that I don't fully understand the answers posted on this topic i.e. "add missing file to proj folder" What file? Is my project folder the same as my working directory?. I tried reinstalling rgdal, with the following commands:

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"))

But I get the same error. I am a Mac user. Can someone walk me through how to deal with this error?

  • The newest PROJ4 version is 4.9.3. I am not completely sure but I assume it could be fixed by just installing the newest version of gdal (currently 2.1.2) system-wide. If you use homebrew, just do brew install gdal2 and follow the instructions. Then restart R and check if everything is working now. – pat-s Jan 14 '17 at 12:25
  • Thanks for your response! I don't use homebrew. I tried downloading the latest version of Proj-4, but when I installed it, I got some strange messages: Last login: Sat Jan 14 19:21:52 on ttys000 LM-SF-NHIRE3:~ XXXXXXX$ /Users/XXXXXXX/Downloads/proj.4-master/INSTALL ; exit; /Users/XXXXXXX/Downloads/proj.4-master/INSTALL: line 1: Basic: command not found/Users/XXXXXXX/Downloads/proj.4-master/INSTALL: line 2: ==================: command not found /Users/XXXXXXX/Downloads/proj.4-master/INSTALL: line 4: These: command not found There were many other lines returning the same message. Any ideas? – user65148 Jan 15 '17 at 4:50
  • Hard to tell what you did wrong / what's missing based on these error messages. If you want a (professional) working setup with up-to-date libraries, I strongly recommend using homebrew (or any other package manager). – pat-s Jan 15 '17 at 11:53
2

There are different approaches compiling the PROJ4 library on macOS:

  1. Use the package manager homebrew. Fist add the osgeo4mac tap: brew tap osgeo/osgeo4mac). Then install proj and gdal2 using brew install <formula>. (Recommended)

  2. Compile from source: Before doing so, remove all existing PROJ4 installations. Multiple installations often cause problems. Then either compile from the Github source or use this guide. When compiling the Github source, be aware that you need to call ./autogen.sh before you can do ./configure (see this issue).

If you also want to upgrade GDAL, make sure before that PROJ4 is installed and configured correctly.

  • For the brew install gdal2 I get the following error brew install gdal2 Error: No available formula with the name "gdal2" ==> Searching for a previously deleted formula... Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... Error: No formulae found in taps. – Andy May 15 '17 at 15:07
  • @Andy you need to call brew tap osgeo/osgeo4mac before because the formula is available in the osgeo4mac tap – pat-s May 15 '17 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.