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 次查看(过去 30 天)
显示 更早的评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170882/image.png)
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 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!