The Octave Forge package repository is no longer actively maintained. Please find Octave Packages at https://packages.octave.org.

Navigation

Operators and Keywords

Function List:

C++ API

: h = rasterdraw (data)
: h = rasterdraw (data, rinfo)
: h = rasterdraw (…, property, value, …)

Draw a GIS raster map.

data can be a file name of a GIS raster data file, or a raster data struct made by rasterread; in the latter case input arg rinfo, a raster info struct also made by rasterread, is also required.

Optionally, property/value pairs can be specified. Only the first four characters of the property need to be entered. The following property/value pairs are recognized:

  • ‘bands’: The value should be a scalar value or vector indicating which band(s) will be drawn in case of multi-band raster data. The default is all bands if the data contains three bands of integer data type, or the first band in all other cases. For non-integer raster data only one raster band can be specified. The number of bands must be 1 or 3.
  • ‘colormap’: The value should be a valid colormap to be used for indexed raster data.
  • ‘missingvalue’: A numerical value to substitute for missing values in the raster data. Default is NaN (for floating point raster data).

The optional output argument h is a graphics handle to the map.

If the raster data to be plotted comprises just one band and a GDAL colortable, that colortable is converted to a colormap and used for drawing the map. The actual raster data are converted to uint8 if no missing data are present.

Behind the scenes imshow() is invoked for the actual drawing for integer or single-band data, or pcolor() for floating point data with missing values.

Note that drawing raster data can be quite slow for big data sets. Drawing maps larger than ~4000x4000 pixels is therefore not advised.

See also: mapshow, rasterread, rasterinfo.

Package: mapping