How to plot a map of Coastline with high resolution
46 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Tammy Viggato
on 29 Jan 2021
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 Comment
ZBMedina
on 1 Feb 2024
What format needs to be downloaded and how is it imported into matlab for use?
See Also
Categories
Find more on Mapping Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!