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

    %% Use geoshape Vectors to Store Latitude and Longitude Values
% 
%%
% Load coastline data from a MAT-file.

% Copyright 2015 The MathWorks, Inc.

load coastlines
%%
% Create an N-by-2 array of coastline latitude and longitude values.
pts = [coastlat coastlon];
%%
% Create a geoshape object and store the latitude and longitude data. If
% you store latitude and longitude coordinate values in an N-by-2 array,
% |geoshape| assigns the |Latitude| property values to the first *column*
% and the |Longitude| property values to the second *column*.
shape = geoshape();
shape(1) =  pts
%% 
% This time create a 2-by-M array of coastline latitude and longitude
% values. Note the semicolon inside the brackets.
pts2 = [coastlat; coastlon];
%%
% Create a geoshape object and store the latitude and longitude data. If
% you store latitude and longitude coordinate values in a 2-by-M array,
% |geoshape| assigns the |Latitude| property values to the first *row* and
% the |Longitude| property values to the second *row*.
shape2 = geoshape();
shape2(1) = pts2