无法正确安装rgdal,我在这里尝试了所有提及的所有建议和建议 R即使在安装软件包后也找不到软件包
library(rgdal)
rgdal: version: 1.4-3, (SVN revision 828)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.2.3, released 2017/11/20
Path to GDAL shared files: C:/Users/xxx/Documents/R/win-library/3.4/rgdal/gdal
GDAL binary built with GEOS: TRUE
Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
Path to PROJ.4 shared files: C:/Users/xxx/Documents/R/win-library/3.4/rgdal/proj
Linking to sp version: 1.3-1
Warning message:
package ‘rgdal’ was built under R version 3.4.4
我已经将R升级到3.6.1
再试一次:
batch_gdal_translate(x, desc, outsuffix = "4.img", of = "HFA", co="TILED=YES")
NULL
Warning messages:
1: In gdal_setInstallation() :
No GDAL installation found. Please install 'gdal' before continuing:
- www.gdal.org (no HDF4 support!)
- www.trac.osgeo.org/osgeo4w/ (with HDF4 support RECOMMENDED)
- www.fwtools.maptools.org (with HDF4 support)
2: In gdal_setInstallation() : If you think GDAL is installed, please run:
gdal_setInstallation(ignore.full_scan=FALSE)
我试图从Rstudio和命令行R 3.6.1 GUI运行它。
我一直尝试这样做,对于安装的库我都得到了积极的结果。
library(raster)
Loading required package: sp
library(rgdal)
rgdal: version: 1.4-4, (SVN revision 833)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.2.3, released 2017/11/20
Path to GDAL shared files: C:/Users/xxx/Documents/R/R-3.6.1/library/rgdal/gdal
GDAL binary built with GEOS: TRUE
Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
Path to PROJ.4 shared files: C:/Users/xxx/Documents/R/R-3.6.1/library/rgdal/proj
Linking to sp version: 1.3-1
library(gdalUtils)
Registered S3 method overwritten by 'R.oo':
method from
throw.default R.methodsS3
我尝试读取的文件是dted文件?
x <- list.files(path = src, pattern = ".dt", full.names = TRUE)
length(x)
batch_gdal_translate(x, desc, outsuffix = "4.img", of = "HFA", co="TILED=YES")
我也尝试了GTIFF .tif格式的上面,我得到相同的错误。但我不是试图读取.hdf文件,而只是读取.dt0,.dt1,.dt2
这将在安装了R的另一台计算机上工作,但是,我试图找出在“此”计算机上的安装有什么问题。
libproj-dev
软件包。