下载m_map工具箱,并set path后,已经有了默认的岸线和地形数据,即m_coast 和 m_elev, 如果需要添加更精细的数据,就要稍微设置一下了
1、coastline:GSHHS 高精度岸线数据 m_gshhs_x系列,用法与m_coast一致
https://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/latest/gshhg-bin-2.3.6.zip
大约113m,解压缩之后 得到以下文件,全部copy到m_map\private 文件夹内,文件名也代表了数据的精细程度;如果你下载的是最新版的m_map1.4n之后的版本,岸线文件需要解压缩到m_map\data 这个文件夹下才可以。新版本修改了默认保存位置。
coarse,low,intermediate,high,full。精细程度与读取速度成反比,使用时量入为出吧。也可以,利用usercoast 命令截取需要的数据,提高速度,如下:
m_gshhs_f('save','mycoast')
m_usercoast('mycoast,'patch',[.7 .7 .7],'edgecolor','none');
gshhs_c.b
gshhs_f.b
gshhs_h.b
gshhs_i.b
gshhs_l.b
wdb_borders_c.b
wdb_borders_f.b
wdb_borders_h.b
wdb_borders_i.b
wdb_borders_l.b
wdb_rivers_c.b
wdb_rivers_f.b
wdb_rivers_h.b
wdb_rivers_i.b
wdb_rivers_l.b
2、etopo2:1弧分地形数据,https://www.ngdc.noaa.gov/mgg/global/global.html
下载地址:
https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/binary/etopo1_ice_g_i2.bin
https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/binary/
(2022年7月5日替换)
约308m,下载后保存在m_map里,或者另外找个地址,记住位置。
然后打开m_etopo2 修改对应位置,修改这4行就可以了
PATHNAME='d:\MATLAB\mytoolbox\topo\'; % Be sure to end the path with a "/" or
% whatever your separator is.
efid=fopen([PATHNAME 'etopo1_ice_g_i2.bin'],'r','l'); % apparently little-endian format
% Now, specify whether this file is grid or cell-referenced
grid=1; % 1 for grid reference, 0 for cell - but I haven't gotten cell reference working yet
% And you have to get the resolution right as well!
resolution=1; % 2 = 2 minute (etopo2), 1 = 1 minute (etopo1)
至此,m_map的基本数据已经完成,have fun
可以测试m_map自带的code
m_proj('lambert','lon',[-10 20],'lat',[33 48]);
[CS,CH]=m_etopo2('contourf',[-5000:500:0 250:250:3000],'edgecolor','none');
m_grid('linestyle','none','tickdir','out','linewidth',3);
colormap([ m_colmap('blues',80); m_colmap('gland',48)]);
brighten(.5);
ax=m_contfbar(1,[.5 .8],CS,CH);
title(ax,{'Level/m',''}); % Move up by inserting a blank line