Octave:添加对映射包的 gdal 支持
octave: add gdal support for mapping package
我正在尝试 运行 一些带有八度的旧 matlab 代码。不幸的是,此代码包含一个 geotiffread
函数,我认为我应该将此函数更改为 rasterread
(package mapping)。
但是,当我尝试安装 mapping
包时,我收到此警告:
octave:7> pkg install mapping-1.4.0.tar.gz
configure: WARNING: GDAL library not found. Reading of raster files will be disabled.
For information about changes from previous versions of the mapping package, run 'news mapping'.
我试过运行八度(5.2.0版)内:
- 一个 Debian Buster 发行版(snap 和 flatpak 包)
- 一个docker容器(MacOS 10.15主机,从mtmiller/octave镜像安装)。
- 在线使用 octave-online 服务,运行输入此代码:
pkg load mapping;
[bands, info] = rasterread ('mexutm250.tiff');
有了这个输出:
octave:3> source("my_script.m")
error: gdalread: reading of raster file with GDAL was disabled during installation
error: called from
rasterread at line 56 column 26
my_script at line 2 column 15
没有尝试成功。
编辑 2:我知道我的 Octave 安装没有 GDAL 支持。我想使用带有完整 mapping
包和 GDAL 支持的 Octave,而无需重新编译它。有一种方法可以做到这一点(例如更新 docker 安装中的库路径以添加 libgdal
库)?
如果不重新编译 Octave 就无法添加 GDAL 支持,是否有一个指南可以轻松完成?
编辑 3:我已经安装了 gdal 依赖项:
$ sudo aptitude search gdal |grep ^i
[sudo] password for virtuser:
i gdal-bin - Geospatial Data Abstraction Library - programmi di utilità
i A gdal-data - libreria Geospatial Data Abstraction Library - file di dati
i libgdal-dev - libreria Geospatial Data Abstraction Library - file di sviluppo
i libgdal20 - libreria Geospatial Data Abstraction Library
谢谢。
按照其中一条评论的建议,检查
>> news mapping
(也在 https://octave.sourceforge.io/mapping/NEWS.html)
查看引入 rasterread 的映射 1.2.1,它指出:
** New features
Reading GIS raster data: A first go is provided using
functions rasterread.m and rasterinfo.m. Both invoke binary
function gdalread() of which an initial version was provided
by Shashank Khare. rasterread.m and rasterinfo.m can read
and return info on any raster data type that the underlying
GDAL library can read. As such, separate functions for e.g.,
GeoTIFF and ArcGrid etc. are not required.
To make use of these functions the GDAL library must be
present on your system => GDAL is a suggested dependency.
您应该能够使用您喜欢的安装方法在 Debian 中安装 the GDAL library。
不确定之后是否需要 uninstall/reinstall 映射包,但是如果 unload/reload 没有删除消息,请尝试一下,看看映射是否能够看图书馆。
当我从 debian 存储库安装八度包时,我得到了八度与 GDAL 集成。我需要八度 5.2,所以我切换到 Ubuntu 20.04.
我正在尝试 运行 一些带有八度的旧 matlab 代码。不幸的是,此代码包含一个 geotiffread
函数,我认为我应该将此函数更改为 rasterread
(package mapping)。
但是,当我尝试安装 mapping
包时,我收到此警告:
octave:7> pkg install mapping-1.4.0.tar.gz
configure: WARNING: GDAL library not found. Reading of raster files will be disabled.
For information about changes from previous versions of the mapping package, run 'news mapping'.
我试过运行八度(5.2.0版)内:
- 一个 Debian Buster 发行版(snap 和 flatpak 包)
- 一个docker容器(MacOS 10.15主机,从mtmiller/octave镜像安装)。
- 在线使用 octave-online 服务,运行输入此代码:
pkg load mapping;
[bands, info] = rasterread ('mexutm250.tiff');
有了这个输出:
octave:3> source("my_script.m")
error: gdalread: reading of raster file with GDAL was disabled during installation
error: called from
rasterread at line 56 column 26
my_script at line 2 column 15
没有尝试成功。
编辑 2:我知道我的 Octave 安装没有 GDAL 支持。我想使用带有完整 mapping
包和 GDAL 支持的 Octave,而无需重新编译它。有一种方法可以做到这一点(例如更新 docker 安装中的库路径以添加 libgdal
库)?
如果不重新编译 Octave 就无法添加 GDAL 支持,是否有一个指南可以轻松完成?
编辑 3:我已经安装了 gdal 依赖项:
$ sudo aptitude search gdal |grep ^i
[sudo] password for virtuser:
i gdal-bin - Geospatial Data Abstraction Library - programmi di utilità
i A gdal-data - libreria Geospatial Data Abstraction Library - file di dati
i libgdal-dev - libreria Geospatial Data Abstraction Library - file di sviluppo
i libgdal20 - libreria Geospatial Data Abstraction Library
谢谢。
按照其中一条评论的建议,检查
>> news mapping
(也在 https://octave.sourceforge.io/mapping/NEWS.html)
查看引入 rasterread 的映射 1.2.1,它指出:
** New features Reading GIS raster data: A first go is provided using functions rasterread.m and rasterinfo.m. Both invoke binary function gdalread() of which an initial version was provided by Shashank Khare. rasterread.m and rasterinfo.m can read and return info on any raster data type that the underlying GDAL library can read. As such, separate functions for e.g., GeoTIFF and ArcGrid etc. are not required. To make use of these functions the GDAL library must be present on your system => GDAL is a suggested dependency.
您应该能够使用您喜欢的安装方法在 Debian 中安装 the GDAL library。
不确定之后是否需要 uninstall/reinstall 映射包,但是如果 unload/reload 没有删除消息,请尝试一下,看看映射是否能够看图书馆。
当我从 debian 存储库安装八度包时,我得到了八度与 GDAL 集成。我需要八度 5.2,所以我切换到 Ubuntu 20.04.