www.gusucode.com > map 案例源码 matlab代码程序 > map/ConstructGeoshapeVectorAddFeaturePropertyExample.m

    %% Construct geoshape Vector and Dynamically Add Feature Property
% 
%%
% Load coastline data from a MAT-file.

% Copyright 2015 The MathWorks, Inc.

load coastlines
%%
% Create geoshape vector with latitude and longitude data from coastlines.
s = geoshape(coastlat,coastlon)
%%
% Add a Feature property to the geoshape dynamically and display it.  Note
% that the new Feature property |Name| applies to the entire set of
% vertices defined by the |Geometry| property as representing a line.
s.Name = 'coastline'
%%
% Display the map with coastline data.
figure
worldmap world
geoshow(s.Latitude,s.Longitude)