How to plot a map of Coastline with high resolution

조회 수: 50 (최근 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 CenterFile Exchange에서 Mapping Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by