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.
Inputm shift my coordinates
3 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Axis Labels 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!