【问题标题】:Probably broken install of gdal: gdalUtilsgdal 可能损坏的安装:gdalUtils
【发布时间】:2021-11-10 02:13:17
【问题描述】:

我正在尝试使用gdal_translate,我使用gdal_setInstallation() 指示gdal 路径,因为我的机器上有几个Gdal。昨天这行得通,今天不行,我不知道为什么。任何帮助将不胜感激。

#When I go to set the installation I get this
gdalUtils:: gdal_setInstallation(search_path =  "C:\\Users\\user\\Gdal\\gdalwin32-1.6\\bin\\", rescan = T)
Probably broken install of gdal at 'C:/Users/user/Gdal/GDALWI~1.6/bin/'

#And when I run this next line of code I get a response I do not understand 
sid2tif <- gdal_translate(src_dataset = "C:\\Users\\user\\Desktop\\S2L Project\\GIS ProjectClipping\\Orthos\\2013 Orthos\\0_3.sid", dst_dataset = "0_3.tif", of ="GTiff", output_Raster = T)
Error in current_match & driver_match : 
  operations are possible only for numeric, logical or complex types


#My Environment Variables/System Variable matches = "C:\\Users\\user\\Gdal\\gdalwin32-1.6\\bin\\"

在继续使用 batch_gdal_translate 之前,我试图弄清楚 gdal_translate()。

谢谢!!

【问题讨论】:

  • 我建议在尝试运行 gdalUtils 提供的 R 包装器之前先让 gdal_translate 在 Windows 命令行中工作。

标签: raster gdal sf rgdal proj


【解决方案1】:

如果有人遇到这个问题,我设法弄清楚了,也许它会有所帮助。

我有 5 个版本的 gdal,其中 3/5 没有我需要转换 .sid 文件的 MrSID 插件。我通过使用 cmd 提示符gdalinfo --format MrSID 发现了哪些版本有这个插件。使用具有 MrSID 插件的版本,我能够通过gdal_setInstallation() 将其引导到正确的路径,这允许gdal_translate() 工作。我将此路径添加到我的系统变量路径中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2017-04-02
    • 1970-01-01
    • 2012-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多