1

I'm actually trying to calculate a grid point position in a SRTM grid by row and column count. So I got a position by lat/lon, then calculating the row and column in my hgt-file (this post helped me) and reading the height. After that I want to calculate the position of the grid point at the specific row and column. For that I'm calculating the distance from the grid point to the origin of the grid and then I get the lat/lon of the grid point.

An example:

Lat: 47.743718 = 47º 44' 37.3848"
Lon: 09.260396 = 09º 15' 37.4256"

=> I have to use the file "N47E009.hgt"

47º 44' 37.3848" => (44 * 60)" + 37.3848" = 2677.3848"
09º 15' 37.4256" => (15 * 60)" + 37.4256" =  937.4256"

GridRow = floor(2677.3848" / 3") // =892
GridCol = floor(0937.4256" / 3") // =312

fileRow = 1201 - GridRow
fileCol = (1201 * (fileRow - 1)) + GridCol

//Reading height from hgt file

Calculating position of grid point relative to origin (47N09E):

x = GridCol * 3 * 30.87 //3 arc secs and 1" = 30.87m
z = GridRow * (3 * 30.87 * cos(47)

=> x = 28894m   z = 56339m

If I'm calculating the distance with lat/lon with a tool I'm getting this results:

=> x = 19470m   z = 82700m

So where is my error in reasoning?

  • SRTM stands for Shuttle Radar Topography Mission – Martin F Mar 2 '15 at 16:54
  • Yes, you knew, but I (and i'm sure most readers) didn't. – Martin F Mar 2 '15 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.