Plotting geographic data not oriented on a grid
Show older comments
I have a column vector of data (23038 x 1), which corresponds to a column vector of the same length for latitude and another for longitude. I am attempting to plot this data (I have used surfm, surfacem, pcolorm), but it always causes MATLAB to slow down to the point of crashing. I assume that this is because matlab prefers the data to be oriented at a 2D matrix (grid). Is this correct, and if so how would I convert the data for plotting? Thanks!
Accepted Answer
More Answers (1)
Sean de Wolski
on 1 Nov 2017
For scattered data which is what the column vectors are, use:
scatterm
If those data represent a grid but are oriented as single column vectors, then use geointerp to interpolate to a 2d grid and then call surfm or meshm.
4 Comments
Collin Tuttle
on 1 Nov 2017
Cam Salzberger
on 1 Nov 2017
Edited: Cam Salzberger
on 1 Nov 2017
Assuming that your datapoints are not already in a nice grid layout, you would likely have the best luck either using griddata or constructing a scatteredInterpolant to take the vector data. You can use the regular grid latitude and longitude values as the query points. Once you have your grid data, you can use surfm or similar functions.
Though griddata and scatteredInterpolant don't handle latitude and longitude specifically, they should work so long as you're not running into edge artifacts (points at the poles or wrap-arounds of the Earth).
You could also look into the code for geointerp to see how it does the interpolation using intrinsic coordinates. This helps deal with some of those edge artifacts, and can simplify the intermediary interpolation grids. But it's probably not necessary, and it's usually easier to think in geographic coordinates.
Sean de Wolski
on 1 Nov 2017
Can you provide a small set of data?
Collin Tuttle
on 1 Nov 2017
Categories
Find more on 3-D Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


