How to plot a map of Coastline with high resolution
조회 수: 50 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Mapping Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!