This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Read Global Land One-km Base Elevation (GLOBE) data


[Z,refvec] = globedem(filename,scalefactor)
[Z,refvec] = globedem(filename,scalefactor,latlim,lonlim)
[Z,refvec] = globedem(foldername,scalefactor,latlim,lonlim)


[Z,refvec] = globedem(filename,scalefactor) reads the GLOBE DEM files and returns the result as a regular data grid. The filename is given as a character vector that does not include an extension. GLOBEDEM first reads the ESRI header file found in the subfolder '/esri/hdr/' and then the binary data file filename. If the files are not found on the MATLAB® path, they can be selected interactively. scalefactor is an integer that when equal to 1 gives the data at its full resolution. When scalefactor is an integer n larger than 1, every nth point is returned. The map data is returned as an array of elevations and associated three-element referencing vector. Elevations are given in meters above mean sea level, using WGS 84 as a horizontal datum.

[Z,refvec] = globedem(filename,scalefactor,latlim,lonlim) allows a subset of the map data to be read. The limits of the desired data are specified as vectors of latitude and longitude in degrees. The elements of latlim and lonlim must be in ascending order.

[Z,refvec] = globedem(foldername,scalefactor,latlim,lonlim) reads and concatenates data from multiple files within a GLOBE folder tree. The foldername input is a character vector with the name of the folder that contains both the uncompressed data files and the ESRI header files.


GLOBE, the Global Land One-km Base Elevation data, was compiled by the National Geophysical Data Center from more than 10 different sources of gridded elevation data. GLOBE can be considered a higher resolution successor to TerrainBase. The data set consists of 16 tiles, each covering 50 by 90 degrees. Tiles require as much as 60 MB of storage. Uncompressed tiles take between 100 and 130 MB.


Determine the file that contains the area around Cape Cod. (This example assumes you have already downloaded some GLOBE data tiles.)

latlim = [41 42.5]; lonlim = [-73 -69.9];

ans = 

Extract every 20th point from the tile covering the northeastern United States and eastern Canada. If you specify an empty file name (''), globedem presents a file browser that you use to first select the header file and then select the data file interactively.

[Z,refvec] = globedem('',20);

ans =
   300   540

Extract a subset of the data for Massachusetts at the full resolution.

latlim = [41 42.5]; lonlim = [-73 -69.9];
[Z,refvec] = globedem('f10g',1,latlim,lonlim);

ans =
   181 373

Replace the NaNs in the ocean with -1 to color them blue.

Z(isnan(Z)) = -1;

Extract some data for southern Louisiana in an area that straddles two tiles. Provide the name of the folder containing the data files, and let globedem determine which files are required, read from the files, and concatenate the data into a single regular data grid.

latlim =[28.61 31.31]; lonlim = [-91.24 -88.62];

ans = 

[Z,refvec] = 

ans =
        325.00        315.00


The globedem function reads data from GLOBE Version 1.0. The data is for elevations only. Elevations are given in meters above mean sea level using WGS 84 as a horizontal datum. Areas with no data, such as the oceans, are coded with NaNs.

The data set and documentation are available over the Internet.


For details on locating map data for download over the Internet, see the following documentation at the MathWorks Web site: Finding Geospatial Data.


See Web site for the National Oceanic and Atmospheric Administration, National Geophysical Data Center

Introduced before R2006a

Was this topic helpful?