MATLAB Answers

Mo Ba
0

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

Asked by Mo Ba
on 21 Mar 2017
Latest activity Edited by 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.

  0 Comments

Sign in to comment.

1 Answer

Answer by Gavriel Aminov on 23 Mar 2017
Edited by 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);
where
x1=[1,1,10,10] (pay attention that x-position is parallel to j-index!)
y1=[1,100,1,100]
x2=1:10;
y2=1:100;
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.

  3 Comments

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?
Please publish the text in order to enable copying the lon-lat data from your script and I'll try debug it.
Sorry @Gavriel Aminov for late response. I was waiting for notification if a new comment is added here. below is the commands I used:
x1=[1,1,35,35];
y1=[1,35,1,35];
x2=1:3;
y2=1:35;
lat1=[52.333734,52.334008,52.334013,52.333736];
lon1=[-106.284690,-106.284694,-106.282375,-106.282386];
lat2=interp2(x1,y1,lat1,x2,y2);
lon2=interp2(x1,y1,lon1,x2,y2)
Thank you again for your help.

Sign in to comment.