弧长公式:L=nπr/180°或l=|α|r
地球半径大致是6400千米
以纬度0.000001为例:
弧长=(0.000001/180)×3.14×6400 = 0.000111644444千米
约等于0.1米
纬度*最高/分钟+90到-90
经度*最高/分钟+180到-180
Geohash
geo_code长度和距离的对照表:
geohash length widthheight
1 5,009.4km 4,992.6km
2 1,252.3km 624.1km
3 156.5km 156km
4 39.1km 19.5km
5 4.9km 4.9km
6 1.2km 609.4m
7 152.9m 152.4m
8 38.2m 19m
9 4.8m 4.8m
10 1.2m 59.5cm
11 14.9cm 14.9cm
12 3.7cm 1.9cm
https://en.wikipedia.org/wiki/Geohash#Cell_Dimensions
假设我们的需求是1公里范围内的商户,geo_code的长度设置为5就可以了,GeohashUtils.encodeLatLon(lat, lon, 5)。