Tuesday 25 December 2018

What is the precision of a Geohash


I would like to know the precision of a geohash with a given length. If there is a 'simple' formula you can use to calculate it, that would be extra-cool.


Wikipedia lists the precision up to 8 characters:


#   km
1 ±2500

2 ±630
3 ±78
4 ±20
5 ±2.4
6 ±0.61
7 ±0.076
8 ±0.019

Answer



so one symbol (letters or digits) is base 32 (8 bits) Each first bit is used for high or low window, then subsequent bits divide the precision by 2. (so divide by 8 in the best case) but there is an alternance between lat and long precision, so it ends up dividing by 4 and 8 alternatively.


#   km      

1 ± 2500
2 ± 630
3 ± 78
4 ± 20
5 ± 2.4
6 ± 0.61
7 ± 0.076
8 ± 0.019
9 ± 0.0024
10 ± 0.00060

11 ± 0.000074

Note that, as mentioned on the Wiki page, those values come from a location near the equator, where a degree has nearly the same lenght in X and Y. For a more accurate information, you should start from the lat and long errors, and compute the km precision along X-axis based on the latitude of your position.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...