Extract data given coordinates from a map
    6 次查看(过去 30 天)
  
       显示 更早的评论
    
Dear all
I just begin to work with Matlab. I have to extract data given coordinates(borders) from a map. I have the matrixes with LAT, LON and DATA. How can I indicate the borders of my area with given coordinates?
Or maybe it's easier to get data from a figure which I've already made with my coordinates.
I'd appreciate your help and time. Thank you in advance!
0 个评论
回答(1 个)
  Kostas
      
 2015-3-12
        
      编辑:Kostas
      
 2015-3-12
  
      I assume your data is a matrix of the form
data(lat,lon,time)
with dimension of the latitude, longitude and time. So you can just keep the borders of the lat and lon you want finding the indices. Eg if you need to keep the latitudes from 20 to 60 degress North, assuming that you have global latitude from -90 to 90 each 5 degrees:
lat = -90:5:90';
you just find the indices
id = (lat>=20&lat<=60);
data1 = data(id,:,:); % get the latitude dimensions you want and keep all the other dimension
Same approach cab be applied for longitude too
1 个评论
  GOKHAN CAMLIYURT
 2021-7-20
				Dear Kostas, 
I have below data and need to extract only a specific coneres given area lat long. My data is quite large area and hard to run matlab code.
SAmple data as below. 
mmsi	time	lat	long	spd	cog
440102290	20190901000000	129.109255	35.06983	200.2	2.223082085
440956000	20190901000000	129.0868667	35.07701667	355	0
538007311	20190901000000	129.1232417	35.03779833	177.1	3.863928385
265000000	20190901000030	129.0941417	35.07822167	237.7	0
354714000	20190901000030	129.094605	35.09598	167.2	0
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


