Geoscience Reference
In-Depth Information
http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html
As an example we use the data from the i le coastline.txt , which contains an
excerpt from the older GSHHG shoreline database. h e two columns in this
i le represent the longitude/latitude coordinates of NaN -separated polygons or
coastline segments.
NaN NaN
42.892067 0.000000
42.893692 0.001760
NaN NaN
42.891052 0.001467
42.898093 0.007921
42.904546 0.013201
42.907480 0.016721
42.910414 0.020828
42.913054 0.024642
42.915987 0.028749
42.918921 0.032562
42.922441 0.035789
(cont'd)
h e NaN s perform two functions: they provide a means of identifying break
points in the data and they serve as pen-up commands when the Mapping
Toolbox plots vector maps. h e shorelines can be displayed by using
clear
data = load('coastline.txt');
plot(data(:,1),data(:,2)), axis equal
xlabel('Longitude'), ylabel('Latitude')
More advanced plotting functions that are contained in the Mapping Toolbox
(MathWorks 2014a) allow an alternative version of this plot to be generated
(Fig. 7.1).
axesm('MapProjection','lambert', ...
'MapLatLimit',[0 15], ...
'MapLonLimit',[35 55], ...
'Frame','on', ...
'MeridianLabel','on', ...
'ParallelLabel','on');
plotm(data(:,2),data(:,1));
Note that the input for plotm must be in the correct order, with the latitude
entered i rst, followed by the longitude (i.e., the second column of the data
matrix must be entered i rst). In contrast, the function plot requires an xy
input, i.e., input must be in the opposite order, with the i rst column of the
matrix entered i rst. h e function axesm dei nes the map axis and sets various
Search WWH ::




Custom Search