How can I plot my coórdinates on top of the map, Ans how can I choose my own area? Cannot find a tutorial on the subject.

5 views (last 30 days)
In the code my questions
kind reagrds Ellen
land = readgeotable("landareas.shp");
geoplot(land)
%how can I limit the chart lat 50-52 and lon 2.5-4.5
% and show the coordinates above this chart?
% Is there a tutorial how to?
% Coördinates to display
station1_lat = 51.9775;
station1_lon = 4.12;
station2_lat = 51.619722;
station2_lon = 3.681944;
station3_lat = 51.442222;
station3_lon = 3.596111;
station4_lat = 51.233333;
station4_lon = 2.916667;
% create figure
figure;
% Plot the stations on the map
geoshow(station1_lat, station1_lon, 'DisplayType', 'point', 'Marker', 'o', 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'r', 'MarkerSize', 10);
geoshow(station2_lat, station2_lon, 'DisplayType', 'point', 'Marker', 'o', 'MarkerEdgeColor', 'b', 'MarkerFaceColor', 'b', 'MarkerSize', 10);
geoshow(station3_lat, station3_lon, 'DisplayType', 'point', 'Marker', 'o', 'MarkerEdgeColor', 'g', 'MarkerFaceColor', 'g', 'MarkerSize', 10);
geoshow(station4_lat, station4_lon, 'DisplayType', 'point', 'Marker', 'o', 'MarkerEdgeColor', 'm', 'MarkerFaceColor', 'm', 'MarkerSize', 10);
% add a legend
legend('Hoek van Holland', 'Roompot Buiten', 'Vlissingen', 'Oostende');
% add a title
title('Kaart met de locaties van de stations');

Accepted Answer

Kevin Holly
Kevin Holly on 18 Mar 2024
land = readgeotable("landareas.shp");
geoplot(land)
geolimits([50 52], [2.5 4.5]) % Set geographic limits
% Coördinates to display
station1_lat = 51.9775;
station1_lon = 4.12;
station2_lat = 51.619722;
station2_lon = 3.681944;
station3_lat = 51.442222;
station3_lon = 3.596111;
station4_lat = 51.233333;
station4_lon = 2.916667;
% create figure
hold on
% Plot each station with specific colors
geoplot(station1_lat, station1_lon, 'o', 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'r', 'MarkerSize', 6, 'DisplayName', 'Station 1')
geoplot(station2_lat, station2_lon, 'o', 'MarkerEdgeColor', 'b', 'MarkerFaceColor', 'b', 'MarkerSize', 6, 'DisplayName', 'Station 2')
geoplot(station3_lat, station3_lon, 'o', 'MarkerEdgeColor', 'g', 'MarkerFaceColor', 'g', 'MarkerSize', 6, 'DisplayName', 'Station 3')
geoplot(station4_lat, station4_lon, 'o', 'MarkerEdgeColor', 'm', 'MarkerFaceColor', 'm', 'MarkerSize', 6, 'DisplayName', 'Station 4')
hold off
% add a legend
legend({'land','Hoek van Holland', 'Roompot Buiten', 'Vlissingen', 'Oostende'},'Location','northeastoutside');
% add a title
title('Kaart met de locaties van de stations');
Here are some Geographic Plot Examples. The geoshow function does not work with a geographic axes, but rather with axesm-based map (previously referred to as map axes).

More Answers (0)

Categories

Find more on Geographic Plots in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!