Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
69 views
in Technique[技术] by (71.8m points)

geohashing - geohash string length and accuracy

if length of geohash string is more, it is more accurate. But is there any direct relationship like if length is 7 it is providing 100 meter accuracy,

i.e. if two geohash (and either of their bounding box) is having first 7 char matching, both should be near 100 meter etc?

I am using geohash for finding, all near-by location for given geohash, with their distance

Also any directway to calculate distance between two geo-hash? (one way is to decode them to lat/lng, and then calculate distance)

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Saw a lot of confusion around geohashing so I am posting my understanding so far. The principle behind geohash is very simple, you can create your own version. For instance consider following geo-point,

156.34234534,-23.343423345

In the above example, 156 represents degrees, 2 digits after decmal (34) represents decimal minute and rest, (34.5334) represents seconds.

If you remember school geography circumference of earth at equator is about 40,000kms and, number of degrees around the earth (latitudes or longitudes) is 360. So at the widest point each degree of latitude and longitude span equals to about 110kms (40,000/360).

So if you encode the above coordinates as, "156-23" (including negative sign), this will give you (110kmx110km) box.

You can go on and increase the precision, Fist digit of minute (156.3-23.3) will give you (10kmx10km) box (each minute span equals 1km).

Increase this to include first digit of second you get (100mx100m)box, each extra digit will add precision to another degree. Geohashing is just the way to represent the above figure in an encoded form. You can happily use the above format as well!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...