How to plot a map of Coastline with high resolution

46 ビュー (過去 30 日間)
Lindsay Powley
Lindsay Powley 2020 年 5 月 27 日
コメント済み: ZBMedina 2024 年 2 月 1 日
I am working on a project that predicts ocean currents, but before I get started I need to dispaly a map of the coastline that shows the lat,lon points of each bouy I am using data from. I followed the Converting Coastline Data (GSHHG) to Shapefile Format page on Math works but I get a section of the coastline that is much too low resolution for what I am looking for. Whats the best way to get around this? the file I downloaded is "gshhg-gmt-2.3.7.tar.gz" but i can't get that to work so I am using the included gshhs_c.b.gz file on MATLAB
I get a plot like this:
but id like to get more resolution with the coastine that this map has:
workingFolder = tempdir;
files = gunzip('gshhs_c.b.gz', workingFolder);
filename = files{1};
indexfile = gshhs(filename,'createindex');
latlim =[33.25 34];
lonlim =[-119 -117.24];
S = gshhs(filename, latlim, lonlim);
delete(filename)
delete(indexfile)
S(1)
levels = [S.Level];
L1 = S(levels == 1);
L2 = S(levels == 2);
L3 = S(levels == 3);
L4 = S(levels == 4);
figure
axesm('mercator','MapLatLimit', latlim, 'MapLonLimit', lonlim)
gridm; mlabel; plabel
geoshow([L1.Lat], [L1.Lon], 'Color', 'blue')
geoshow([L2.Lat], [L2.Lon], 'Color', 'blue')
geoshow([L3.Lat], [L3.Lon], 'Color', 'blue')
geoshow([L4.Lat], [L4.Lon], 'Color', 'blue')
tightmap

回答 (1 件)

Tammy Viggato
Tammy Viggato 2021 年 1 月 29 日
My understanding is that you need a higher resolution dataset than is currently shipped with MATLAB. There are many higher resolution datasets available which you can download and import into MATLAB. Natural Earth may be a good starting point to look for such a dataset, but to reiterate there are many good ones available depending on your specific use case.
  1 件のコメント
ZBMedina
ZBMedina 2024 年 2 月 1 日
What format needs to be downloaded and how is it imported into matlab for use?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMapping Toolbox についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by