trouble installing “sf” due to “gdal”

后端 未结 1 1807
长情又很酷
长情又很酷 2021-01-07 19:00

I can\'t install the package \"sf\" on R. Seems there is an issue with gdal. No idea how to resolve it.

> install.packages(\"sf\")

  There is a binary v         


        
1条回答
  •  迷失自我
    2021-01-07 19:25

    Facing similar problem I have followed the steps below:

    1. On Terminal: gdalinfo --version to check which gdal version do you have. Mine was GDAL 2.2.0, released 2017/04/28 after brew update and brew upgrade
    2. From here: https://github.com/r-spatial/sf, instructions for macOS, as I have already gdal installed, I have used only brew unlink gdal and then brew link --force gdal2
    3. I reinstalled rgdal on R: install.packages("rgdal", repos = "http://cran.us.r-project.org", type = "source") and I have confirmed it was compiled with configure: GDAL: 2.2.0
    4. Finally, install.packages("sf") and it required to be compiled: binary source needs_compilation sf 0.5-3 TRUE
    5. Again, I have confirmed configure: GDAL: 2.2.0 and checking GDAL version >= 2.0.0... yes

    After that, I have the new version installed: library(sf) Linking to GEOS 3.6.2, GDAL 2.2.0, proj.4 4.9.3

    I hope it could be a solution for you too.

    0 讨论(0)
提交回复
热议问题