Inputm shift my coordinates

1 回表示 (過去 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 Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by