Clear Filters
Clear Filters

Inputm shift my coordinates

1 view (last 30 days)
Maha
Maha on 1 Mar 2018
Answered: Maha on 5 Mar 2018
Hello,
I'm trying to extract coordinate of some points on my map, and to plot green point at extracted position (for visual comfort).
I use the inputm function because it gives me what I look for (latitude and longitude). The problem is my extracted latitude is shifted northward (my longitude is okay). I saw someone with the same problem but the question was never answered.
Here is my fig, 2 green points are on it. To understand better, when I click on the bot one (~16.5°N) it extract me coordinates of the top one (~17°N).
Here is my code :
if true
% code
if Extract=='yes'
button = 1;
position=zeros(1,2);
while sum(button) ~=3 % stop with right mouse click
h=axesm('MapProjection','mercator','MapLatLimit',[latGz(1,1)...
latGz(end,end)],'MapLonLimit',[lonGz(1,1) lonGz(end,end)]);
[latpoint, lonpoint, button] = inputm(n,h);
if button~=3
hold on
m_plot(lonpoint,latpoint,'g.','markers',20);
end
coord=[latpoint lonpoint];
position=[position; coord];
end
end
end
Does someone know how to fix it please ? M.

Accepted Answer

Maha
Maha on 5 Mar 2018
I found a solution, for people having the same issue in future, use ginput to extract pixel data and convert it in lat/lon with m_xy2ll. Still don't know why inputm shift northward ! M.

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!