Main Content


(To be removed) Read 5-minute global terrain elevations from TerrainBase

tbase will be removed in a future release. Use readgeoraster instead. For more information, see Compatibility Considerations.


[Z,refvec] = tbase(scalefactor)
[Z,refvec] = tbase(scalefactor,latlim,lonlim)


[Z,refvec] = tbase(scalefactor) reads the data for the entire world, reducing the resolution of the data by the specified scale factor. The result is returned as a regular data grid and an associated three-element referencing vector.

[Z,refvec] = tbase(scalefactor,latlim,lonlim) reads the data for the part of the world within the latitude and longitude limits. The limits must be two-element vectors in units of degrees.


TerrainBase is a global model of terrain and bathymetry on a regular 5-minute grid (approximately 10 km resolution). It is a compilation of the public domain data from almost 20 different sources, including the DCW-DEM and ETOPO5. The data set was created by the National Geophysical Data Center and World Data Center-A for Solid Earth Geophysics in Boulder, Colorado.


collapse all

Set the scale factor to 1 and set the longitude and latitude limits. This example reads the data for Korea and Japan.

scalefactor = 1;
latlim = [30 45];
lonlim = [115 145];

Read the data and view the size of the returned variables.

[Z,refvec] = tbase(scalefactor,latlim,lonlim);
Name       Size         Bytes  Class

 Z        180x360       518400  double array
 refvec     1x3             24  double array

Version History

Introduced before R2006a

expand all

R2021b: Warns

Support for reading the TerrainBase Global Terrain Model will be removed. In addition, raster reading functions that return referencing vectors issue a warning that they will be removed in a future release, including tbase. Use a supported data set and return a raster reference object using readgeoraster instead.

Reference objects have several advantages over referencing vectors.

  • Unlike referencing vectors, reference objects have properties that document the size of the associated raster, its geographic limits, and the direction of its rows and columns. For examples of reference object properties, see GeographicCellsReference and MapPostingsReference.

  • You can manipulate the limits of rasters associated with reference objects using the geocrop or mapcrop functions.

  • You can manipulate the size and resolution of rasters associated with reference objects using the georesize or mapresize functions.

  • Most functions that accept referencing vectors as input also accept reference objects.

For information about finding data sets, see Find Geospatial Raster Data.