MATLAB Answers

How to find Lon. and Lat. of a field by having a few sample GPS points?

9 views (last 30 days)
Mo Ba
Mo Ba on 21 Mar 2017
Edited: Mo Ba on 27 Apr 2017
I'm working on a field and for some reasons I need to find the exact Longitude and Latitude for different points on the field. Please have a look at the attached picture. Let's say I have such a field and I have divided it into 1000 different cells. Because the field is huge, it's not possible for me to capture Long. and Lat using GPS for all cells. I was thinking it might be possible to capture GPS data at some points (e.g. at cells number 1, 5, 10, 15, 20, ...) and then find others by interpolation or something like that. Do you have any idea how to do this? How can I find exact Long. and Lat for all cells by having some GPS sample points? Do you think using a simple MATLAB interpolation is a good option? Thanks in advance for your suggestions and ideas.


Sign in to comment.

Answers (1)

Gavriel Aminov
Gavriel Aminov on 23 Mar 2017
Edited: Gavriel Aminov on 23 Mar 2017
If the cells of the field are distributed uniformly, and if the height of each cell is weak function of 2D position, then the answer seems simple:
  1. Rearange the numeration of the cells to MxN=100x10 (use IND2SUB and SUB2IND)
  2. Measure the Lon&Lat of the bounding cells: (1,1),(100,1),(1,10),(100,10)
  3. Make regular interp2 over Lon values and Lat values separately like this:
  • lon2=interp2(x1,y1,lon1,x2,y2);
  • lat2=interp2(x1,y1,lat1,x2,y2);
x1=[1,1,10,10] (pay attention that x-position is parallel to j-index!)
After the above works, it is also possible to make the results more precise by taking additional measurements at some randomly distributed cells WITHIN the field and executing scattered 2D-interpolation with GRIDDATA at the same manner as with INTERP2.
You can use 'linear' or 'spline' options in both cases, as the extrapolation is not required.


Mo Ba
Mo Ba on 24 Mar 2017
Thank you for your comprehensive answer Gavriel! And yes the field is distributed uniformly. I tried the way you mentioned but I'm getting an error which I don't understand what does it say? I just decreased the grid size to 3*35 instead of 100*10. Please have a look at the attached picture and please see if you understand what's my mistake?
Gavriel Aminov
Gavriel Aminov on 26 Mar 2017
Please publish the text in order to enable copying the lon-lat data from your script and I'll try debug it.
Mo Ba
Mo Ba on 21 Apr 2017
Sorry @Gavriel Aminov for late response. I was waiting for notification if a new comment is added here. below is the commands I used:
Thank you again for your help.

Sign in to comment.

Sign in to answer this question.