%% Convert Route to Geographic Coordinates
% Establish an anchor point in the geographic coordinate system. These latitude and longitude coordinates specify Boston, MA.

origin = [42.3648, -71.0214, 10.0];

%  Generate local route in Cartesian coordinates, x, y, and z.

z = zeros(1,101);    % maintain height of 0 m
x = 0:1000:100000;   % 100 km in 1 km increments
y = x;               % move 100 km northeast

% Convert the local route coordinates to geographic coordinates, latitude and longitude.

[lat,lon] = local2latlon(x,y,z,origin);

%  Visualize the route on a map.

zoomLevel = 12;
player = geoplayer(lat(1),lon(1),zoomLevel);
plotRoute(player,lat,lon);

% Copyright 2019 The MathWorks, Inc.