Search code examples
mappinggisoctavegdal

octave: add gdal support for mapping package


I am trying to run some old matlab code with octave. Unfortunately this code contains a geotiffread function and I think I should change this function with rasterread (package mapping). However, when I try to install the mapping package I get this warning:

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'.

I tried to run octave (5.2.0 version) within:

  • a Debian Buster distribution (snap and flatpak package)
  • a docker container (MacOS 10.15 host, installed from the mtmiller/octave image).
  • online with the octave-online service, running this code:
pkg load mapping;
[bands, info] = rasterread ('mexutm250.tiff');

With this output:

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

No attempt was successful.


EDIT 2: I know that my octave installations are without GDAL support. I would like to use octave with full mapping package, and GDAL support, without recompile it. There is a way to do it (e.g. update a library path within the docker installation to add the libgdal library)?

If there is no way to add GDAL support without recompile octave, there is a guide to do it with minimal effort?

EDIT 3: I already installed the gdal dependencies:

$ 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

Thank you.


Solution

  • I got octave with GDAL integration when I installed the octave package from the debian repository. I needed octave 5.2, so I switched to Ubuntu 20.04.