rgdal软件包安装 [英] rgdal package installation

查看:144
本文介绍了rgdal软件包安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的问题并不完全是如何通过R绘制地图,因为我已经发现了一个非常不错的示例

The issue here is not exactly how to plot maps through R, as I have found already a pretty nice example here, but rather how to make it work. In fact, I am unable to load library rgdal:

library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’

但是,当我尝试手动安装以上软件包时,出现以下错误:

However, when I try to install the above package manually, I get the following error:

....
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/eualin/R/i686-pc-linux-gnu-library/2.15/rgdal’
Warning in install.packages : installation of package ‘/home/eualin/Downloads/rgdal_0.8-5.tar.gz’ had non-zero exit status

欢迎任何输入!

推荐答案

如果您查看 CRAN上的打包页面,您将看到以下内容:

I f you look at the package page on CRAN, you will see the following :

系统要求:用于从源代码构建:GDAL> = 1.7.1库来自 http://trac.osgeo.org/gdal/wiki/DownloadSource 和PROJ.4(proj> = 4.4.9),来自 http://trac.osgeo.org/proj/;William Kyngesburye在 http://www.kyngchaos.com/上构建的GDAL OSX框架可用于源代码安装在OSX上.

SystemRequirements: for building from source: GDAL >= 1.7.1 library from http://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.4.9) from http://trac.osgeo.org/proj/; GDAL OSX frameworks built by William Kyngesburye at http://www.kyngchaos.com/ may be used for source installs on OSX.

由于您似乎在Linux下,所以总是从源代码构建软件包,因此必须在系统上安装相应的库.如果您使用的是Mint,Ubuntu或其他Debian衍生产品,则可以执行以下操作:

As you seem to be under Linux, you always build package from source, so you will have to install the corresponding libraries on your system. If you are under Mint, Ubuntu or another Debian derivative, you can do :

$ sudo apt-get install libgdal1-dev libproj-dev

在基于Debian的系统中,仍然有用的一个技巧是安装 apt-file 软件包并运行:

One tip that can be useful, still under a Debian based system, is to install the apt-file package and run :

$ sudo apt-file update

然后,当您收到错误消息:

Then, when you get an error such as :

configure: error: proj_api.h not found in standard or given locations.

您可以使用以下命令查找必须安装哪个软件包才能获得丢失的文件:

You can use the following command to find which package you must install to get the missing file :

$ apt-file search proj_api.h
libproj-dev: /usr/include/proj_api.h

这篇关于rgdal软件包安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆