TransWikia.com

What is the precision of Geohash?

Geographic Information Systems Asked by Gundon on July 15, 2021

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

One Answer

So one symbol (letters or digits) is base 32 (5 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.

With the first character, the world is split into a grid of 8 columns and 4 rows. So the size of each grid cell is 360°/8=45° in longitude, and 180°/4=45° in latitude. Considering the center of this cell, the maximum error on the location that you provide will be 22.5° of longitude and 22.5° of latitude. Because of the alternance 84 and 48, the precision (in degree) of the latitude is half of the precision of the longitude for every even number, and they are equal for every odd number. With two digits, the maximum error is 22.5°/4= 5.625° of longitude and 22.5°/8=2.8125° of latitude.

To link with Wikipedia as mentioned in the question, one degree is approximately 110km in both directions near the equator (=worst case), so you have:

#   (maximum X axis error, in 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

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 (the size of the meridians doesn't change). The maximum error along the X-axis will indeed decrease when the latitude increases. For example, the precision along the X-axis inside the cell located between 45 and 90° of latitude (b,c,f,g,u,v,y,z) will be (in the worst case) 2500 km*cos(45°)~= 1770 km.

Correct answer by radouxju on July 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP