I'm using this tool to get the tile number (horizontal/vertical) from lat/long. Is there any code,preferably python, to get the tile number ? I tried using this tool. But it gives wrong tile number. Here's my code:
import numpy as np data = np.genfromtxt('sn_bound_10deg.txt', skip_header = 7, skip_footer = 3) lat,lon = -25.439538,149.053418 in_tile = False i = 0 while(not in_tile): #print data[i,0],data[i,1],data[i, 4],data[i, 5],data[i, 2],data[i, 3] in_tile = lat >= data[i, 4] and lat <= data[i, 5] and lon >= data[i, 2] and lon <= data[i, 3] i += 1 vert = data[i-1, 0] horiz = data[i-1, 1] print('Vertical Tile:', vert, 'Horizontal Tile:', horiz)
The output tile from the above code is: h30v11
Expected output and output from the online calculator is: h31v11
Here's the sn_bound_10deg.txt file.