找回密码
 注册
查看: 738|回复: 0

R语言 RSAGA包 rsaga.env()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-28 21:17:56 | 显示全部楼层 |阅读模式
rsaga.env(RSAGA)
rsaga.env()所属R语言包:RSAGA

                                        Set up the RSAGA Geoprocessing Environment
                                         RSAGAGEO处理环境设置

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

rsaga.env creates a list with system-dependent information on SAGA path, module path and data (working) directory. Such a list is required by all
rsaga.env与系统相关的信息SAGA路径,模块路径和数据(工作)目录创建一个列表。这样一个列表所需要的所有


用法----------Usage----------


rsaga.env( workspace=".",
    cmd = ifelse(.Platform$OS.type=="windows", "saga_cmd.exe", "saga_cmd"),
    path, modules, version, check.libpath = TRUE, check.SAGA = TRUE,
    check.PATH = .Platform$OS.type == "windows",
    check.os.default = TRUE,
    os.default.path = ifelse(.Platform$OS.type=="windows",
        "C:/Progra~1/SAGA-GIS",
        sub('/saga_cmd','',system2('which',args='saga_cmd',stdout=TRUE))) )



参数----------Arguments----------

参数:workspace
path of the working directory for SAGA; defaults to the current directory (".").
SAGA的工作目录路径,默认为当前目录(".")的。


参数:cmd
name of the SAGA command line program; defaults to saga_cmd.exe, its name under Windows
名称的的SAGA命令行程序,在Windows下默认saga_cmd.exe,它的名字


参数:path
path in which to find cmd; rsaga.env is usually able to find SAGA on your system if it is installed; see Details.
路径中找到cmdrsaga.env通常是能够找到SAGA您的系统是否已安装;看到详细信息。


参数:modules
path in which to find SAGA libraries; see Details
在其中找到SAGA库的路径详细,


参数:version
optional character string: SAGA GIS (API) version,  e.g. "2.0.8"; if missing, a call to rsaga.get.version is used to determine version number of SAGA API  
可选的字符串:SAGA GIS(API)版本,例如: "2.0.8";如果缺失,调用rsaga.get.version用于确定SAGA API的版本号


参数:check.libpath
if TRUE (default), first look for SAGA in the folder where the RSAGA package is installed
如果TRUE(默认),先看看SAGA RSAGA包安装的文件夹中


参数:check.SAGA
if TRUE (default), next check the path given by the environment variable SAGA, if it exists
如果TRUE(默认),下次检查的环境变量SAGA给定的路径,如果存在的话


参数:check.PATH
if TRUE (default on Windows), next look for SAGA in all the paths in the PATH environment variable; defaults to FALSE on non-Windows OS
如果TRUE(Windows默认设置),在所有的PATH环境变量中的路径下寻找SAGA默认FALSE非Windows操作系统


参数:check.os.default
if TRUE, look for SAGA in the folder specified by os.default.path.
如果TRUE,为SAGA在os.default.path指定的文件夹中。


参数:os.default.path
under Windows, C:/Progra~1/SAGA-GIS; under unix, an attempt is made to locate saga_cmd
在Windows下,C:/Progra~1/SAGA-GIS; unix下,尝试定位saga_cmd


Details

详细信息----------Details----------

IMPORTANT: Unlike R functions such as options, which changes and saves settings somewhere in the background, rsaga.env does not actually 'save' any settings, it simply creates a list that can (and has to) be passed to other rsaga.* functions. See example below.
重要提示:与R功能,如options,改变,并保存在后台设置的地方,rsaga.env不实际“拯救”任何设置,它只是简单地创建一个列表,可以(并有)传递给其他rsaga.*功能。见下面的例子。

I strongly recommend to install SAGA GIS in "C:/Program Files/SAGA-GIS" in the case of English-language Windows platforms (the equivalent non-English installation folder in the case of non-English Windows versions seems to work as well). If this is the only SAGA GIS copy on the computer and you do not define a Windows environment variable SAGA, then RSAGA should normally be able to find your SAGA GIS installation.
我强烈建议安装SAGA GIS在"C:/Program Files/SAGA-GIS"在英语Windows平台的情况下(相当于非英语的情况下,非英语版本的Windows安装文件夹中,似乎可以同时工作)。如果这是唯一的SAGA GIS复制在电脑上,你没有定义的Windows环境变量SAGA,然后RSAGA通常应该是能够找到您的SAGA GIS安装。

rsaga.env tries to compile infromation on the (R)SAGA environment. If path is missing, rsaga.env first looks for an environment variable SAGA; if this is undefined, it checks the current working directory, then the paths given in the  PATH environment variable, and finally the function's guess is "C:/Progra~1/SAGA-GIS" (or "/usr/local/bin" on non-Windows systems).
rsaga.env尝试编译infromation,对(R)的SAGA环境。如果path失踪,rsaga.env先寻找一个环境变量SAGA,这是不确定的,它会检查当前的工作目录,然后给定路径PATH环境变量中,并最终该函数的猜测是"C:/Progra~1/SAGA-GIS"("/usr/local/bin"在非Windows系统)。

The default modules folder under Windows is the modules subfolder of the SAGA binaries' folder. The SAGA_MLB environment variable is not being checked by rsaga.env.
默认modules文件夹在Windows下是modules SAGA二进制文件的文件夹的子文件夹。没有被检查SAGA_MLBrsaga.env环境变量。

Under Unix, the default modules folder is as specified in the SAGA_MLB environment variable. If this is empty / not set, then the following backup path is used. If path ends with "/bin",  then "/bin" is changed to "/lib/saga" and taken as the modules path; otherwise, /usr/local/lib/saga is used.
在Unix中,默认情况下modules文件夹中指定SAGA_MLB环境变量。如果这是空的/没有设置,那么下面的备份路径。 path如果结尾的“/ bin”目录,然后是“/ bin”改变“的/ lib /传奇”的modules路径,否则,/usr/local/lib/saga 。


值----------Value----------

A list with components workspace, cmd, path, and modules, with values as passed to rsaga.env or default values as described in the Details
组件列表workspace,cmd,path和modules“中描述的值传递给rsaga.env或默认值的详细信息


注意----------Note----------

Note that the default workspace is ".", not getwd(); i.e. the default SAGA workspace folder is not fixed, it changes each time you change the R working
请注意,默认workspace是".",而不是getwd();,即默认SAGA工作区文件夹是不固定的,它改变了每次更改的R


(作者)----------Author(s)----------


Alexander Brenning



参见----------See Also----------

rsaga.get.version
rsaga.get.version


实例----------Examples----------


## Not run: [#不运行:]
# Check the default RSAGA environment on your computer:[检查您的计算机上的默认RSAGA环境:]
myenv <- rsaga.env()
myenv
# SAGA data in C:/sagadata, binaries in C:/SAGA-GIS, modules in C:/SAGA-GIS/modules:[SAGA资料在C :/ sagadata的,二进制文件在C :/ SAGA-GIS,在C :/ SAGA-GIS/modules的模块:]
myenv <- rsaga.env(workspace="C:/sagadata", path="C:/SAGA-GIS")
# Unix: SAGA in /usr/bin (instead of the default /usr/local/bin),[UNIX:SAGA在/ usr / bin中(而不是默认的/ usr /本地/ bin中),]
# and modules in /use/lib/saga:[和模块/使用/ lib /佐贺中:]
# myenv &lt;- rsaga.env(path="/usr/bin")[myenv < -  rsaga.env(路径=“/ usr / bin中)]
# Use the 'myenv' environment for SAGA geoprocessing:[使用“myenv”SAGAGEO处理环境:]
rsaga.hillshade("dem","hillshade",env=myenv)
# ...creates (or overwrites) grid "C:/sagadata/hillshade.sgrd"[...创建(或覆盖)电网“C :/ sagadata机构/ hillshade.sgrd”]
# derived from digital elevation model "C:/sagadata/dem.sgrd"[来自数字高程模型的C :/ sagadata / dem.sgrd“]

# Same calculation with different SAGA version:[同样的计算与不同的SAGA版本:]
# (I keep several versions in SAGA-GIS_2.0.x folders[(我一直好几个版本在SAGA-GIS_2.0.x文件夹的]
myenv05 = rsaga.env(path = "C:/Progra~1/SAGA-GIS_2.0.5")
rsaga.hillshade("dem","hillshade205",env=myenv05)

## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-27 03:54 , Processed in 0.029580 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表