Extract data given coordinates from a map

5 views (last 30 days)
Alina
Alina on 12 Mar 2015
Commented: GOKHAN CAMLIYURT on 20 Jul 2021
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!

Answers (1)

Kostas
Kostas on 12 Mar 2015
Edited: Kostas on 12 Mar 2015
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 Comment
GOKHAN CAMLIYURT
GOKHAN CAMLIYURT on 20 Jul 2021
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

Sign in to comment.

Categories

Find more on Geographic Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!