system()的行为与windows下R中的cmd不同
在R中,我执行命令system()的行为与windows下R中的cmd不同,r,windows,system,gdal,rgdal,R,Windows,System,Gdal,Rgdal,在R中,我执行命令 > system('"C:/OSGeo4W64/bin/gdalwarp.exe" -tap -overwrite -tr 100 100 -s_srs "+proj=longlat +datum=WGS84 +no_defs" -t_srs "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS
> system('"C:/OSGeo4W64/bin/gdalwarp.exe" -tap -overwrite -tr 100 100
-s_srs "+proj=longlat +datum=WGS84 +no_defs" -t_srs "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs" -r "bilinear" -of "GTiff" "D:/Maps/EMODnet/output/tmp/tmp.tif"
"D:/Maps/EMODnet/output/tmp/tmp_proj.tif"')
并且得到了错误
错误1:项目:
项目创建操作:选择名称、类型、,
坐标系验证名称、坐标系代码、基准验证名称、,
数据代码、区域使用名称、区域使用代码、文本定义、,
已从大地测量crs中弃用,其中auth_name=?代码=?:没有这样的代码
列:区域\使用\验证\名称错误6:找不到坐标
来自`地理卫星系统'的行动[未知,达图
但是,当我直接在windows cmd终端中执行以下命令时,它是成功的
C:/OSGeo4W64/bin/gdalwarp.exe-tap-overwrite-tr 100-s_srs+proj=longlat+datum=WGS84+no_defs-t_srs+proj=lcc+lat_0=46.5+lon_0=3+lat_1=49+lat_2=44+x_0=700000+y_=6600000+ellps=grp=0+units=m+no_defs-r双线性-r-of gtd:/Maps/EMODnet/output/tmp/tif
知道我为什么会有这样的不同吗?我没有Windows PC了,但我的直觉是,权限和可能的用户在系统中是不同的。也许可以尝试cmd和R中的whoami?你可能想切换到shell。编辑:更广泛的教程+描述:@JBGruber whoami在cmd中无法识别,我使用了echo%USERDOMAIN%\%USERNAME%,它们同时提供sophia\robin.girard