MATLAB: What directory structure does GTOPO30 need for reading in tile directories of topographical data

directoryextractgtopo30Mapping Toolboxstructuretiletiles

I am trying to use the GTOPO30 command to create a map that spans two tiles. My GTOPO30 data files are not on a CD but in a directory: /data/gtopo30/.
The files were retrieved via FTP and there are no "tile directories" as referred to in the GTOPO30 description returned when I type "help gtopo30". A partial directory listing shows:
E060N40.DEM
E060N40.DMW
E060N40.GIF
E060N40.HDR
E060N40.PRJ
E060N40.SCH
E060N40.SRC
E060N40.STX
E060N90.DEM
Here is what I try and the error I receive:
latlim = [30 45]; lonlim = [60 90];
gt30files = gtopo30s(latlim , lonlim)
gt30files =
'e060n90'
'e060n40'
[map,refvec] = gtopo30('/data/gtopo30',5,latlim,lonlim);
??? Error using ==> gtopo30 (gtopo30c)
GTOPO30 file not found.
Error in ==> /usr/local/matlab60/toolbox/map/mapdisp/gtopo30.m
On line 54 ==> [map,refvec] = gtopo30c(varargin{:});
If I use:
[map,refvec] = gtopo30('e060n40',5,latlim,lonlim);
I get a map, but it only uses the single tile. I am trying to write some
automated processes, so I don't want to use the GUI that shows up and asks me to pick the proper *.HDR file.

Best Answer

This enhancement has been made for Release 14 SP1 (R14SP1). For previous product releases, read below for any possible workarounds:
The following describes the directory structure you are looking for. When you download the data from an FTP site, each file needs to be extracted into a tile directory with the name of the compressed files. For example, "e060n40.tar.gz" needs to be extracted into a tile directory named "E060N40". Additionally, all of the tile directories need to be located in the same parent tile directory.
Note the syntax required for the directory path argument when using GTOPO30. The argument requires that the path ends in a slash.
The following is an example that uses GTOPO30 to read files from a directory structure:
latlim = [30 45]; lonlim = [60 90];
gt30files = gtopo30s(latlim , lonlim)
gt30files =
'e060n90'
'e060n40'
% Using:< ftp://edcftp.cr.usgs.gov/pub/data/gtopo30/global/>
% Download "e060n90.tar.gz" into a tile directory named "E060N90".
% Download "e060n40.tar.gz" into a tile directory named "E060N40".
% Extract the data files into their directories.
% To extract in UNIX, e.g. (assuming you have access to gzip and tar):
% gzip -d e060n40.tar.gz
% tar -xf e060n40.tar
% To extract on Windows, use a decompression application such as WinZip.
% *** Note: If extracting on Windows, be sure NOT to use "TAR file smart CR/LF conversion".
% WinZip allows you to DESELECT this option under Options->Configuration...->Miscellaneous->Other.
% To save disk space, you can delete the tar file.
% Change directories into the parent tile directory of "E060N40".
p = [pwd '/']; % Store the path to the parent tile directory while appending a "/"
dir(p)
. .. E060N40 E060N90
[map,refvec] = gtopo30(p,5,latlim,lonlim);
axesm mercator
meshm(map,refvec)