System command calls different version of gdal
12 次查看(过去 30 天)
显示 更早的评论
I am importing .hdf files programatically and need to perform some combinations and transformations using gdal. When I do these commands from terminal (Ubuntu 20.04.2) they run fine. When I use the same command in matlab using system() I get an ERROR 4: file.hdf not recognized as a supported file format. When I check for acceptable formats using the --formats tag hdf4 and hdf5 appear in terminal but not in the Matlab system command. I then checked versions using the --versions tag and found that in terminal I get:
~$ gdalinfo --version
GDAL 3.0.4, released 2020/01/28
~$ which gdalinfo
/usr/bin/gdalinfo
In MATLAB command window I get:
>> system('gdalinfo --version');
GDAL 3.0.2, released 2019/10/28
>> system('which gdalinfo');
/usr/bin/gdalinfo
I have gone through steps to completely delete gdal from my system and confirmed that both terminal and command window return that gdal is not a command and then reinstalled but the same issue appears. I have checked the PATH variable in MATLAB and it says usr/bin is in the path. If anyone can help I would greatly appreaciate it.
0 个评论
回答(1 个)
Sean de Wolski
2021-3-19
编辑:Sean de Wolski
2021-3-19
Can you provide the full path to the gdal executable?
system('<gdalroot>/gdalinfo --version');
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!