I need to transform quadkey column to latitude and longitude using SQL (Postgres to be more specific). It seems like a common problem, but somehow I cannot find a solution.
Example value:
Quadkey: 12302313230320012
I'd like to get lat/lon of the center of the tile.
Any help will be appreciated.
OK, I have solved the problem. It can be wrapped up into one function, but I am posting two steps in case someone will have slightly different problem:
First we can use this function to convert Quadkey to TileXYZ:
And then we can use these formulas to calculate lat and long