Inputm shift my coordinates

8 次查看(过去 30 天)
Maha
Maha 2018-3-1
回答: Maha 2018-3-5
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.

采纳的回答

Maha
Maha 2018-3-5
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by