Get Point data from geoaxes
조회 수: 4(최근 30일)
I'm trying to find a way to get point data from a Matlab basemap with the mouse. I have a workaround solution, though I find it very stupid to have to do it this way. The issue I'm facing is that ginput, getpts, inputm, and custom matlab scripts that I've found will not cooperate with "geoaxes". I've tried GinputC,ginput_ax, ginputB, and am working on my own rendition to solve the issue. The reason I'm using the basemap is it provides me the service offline of zooming, panning, and viewing data on the map. I'd rather not recreate these functions and increasing resolution with zoom on my own.
Base Script (includes a snipit of Data Manager script)
Color = [.5 .5 .5]
Test = Manager();
Test.f = figure('Color',Color,'Position', [360 500 1500 700]);
Test.plot.Axes = geoaxes('Parent',Test.f,...
'Position', [60 85 1050 600]);
%% SEPARATE SCRIPT FOR DATA MANAGEMENT
classdef Manager < handle
My current workaround (really dumb), Is to "getframe" and "frame2im" the entire figure, Create another figure of the exact same size over top the first, Give figure(2) axes that are the entire figure, and imshow "Figure 1" essentially in Figure 2. Then, I can use any ginput script I like to get the x,y position. Compare that to the limits of the "geoaxes" and convert the pixel x,y to Lat,Long. Delete Figure 2 when done, and plot the saved points back in figure 1.
F = getframe(Test.f);
[X Map] = frame2im(F);
Jack = figure('Color',Color,'Position', [360 500 1500 700]);
JackAxes = axes('Units','normalized','Position',[0 0 1 1])
[x,y] = ginput(4);