Trouble getting latest version of GDAL on ubuntu running R

☆樱花仙子☆ 提交于 2019-12-01 15:06:59

问题


My Ubuntu machine has latest GDAL (2.2.1, released 2017/06/23). But R complains that I have gdalversion <2.0

configure: CC: gcc -std=gnu99 configure: CXX: g++ checking for gdal-config... /usr/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 1.11.3 checking GDAL version >= 2.0.0... no configure: error: sf is not compatible with GDAL versions below 2.0.0

How can i direct R to access GDAL (2.2.1 version) already installed on Ubuntu?


回答1:


You may need to uninstall all traces of gdal then re-install it from the ubuntugis-unstable source. The following helped me solve a similar problem:

sudo apt remove libgdal-dev
sudo apt remove libproj-dev
sudo apt remove gdal-bin
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable

Make sure a version >= 2.0 appears when you execute this line

sudo apt-cache policy libgdal-dev

If so, run

    sudo apt update
    sudo apt install libgdal-dev

I could then successfully execute in R 3.4.2 in Ubuntu 14.04 ("Trusty Tahr"):

install.packages('rgdal')


来源:https://stackoverflow.com/questions/46289630/trouble-getting-latest-version-of-gdal-on-ubuntu-running-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!