def find_neighbor():
h2c = pickle.load(open("comps/mobike/sol_carl/data/h2c.p","rb"))
c2h = pickle.load(open("comps/mobike/sol_carl/data/c2h.p","rb"))
print(len(h2c),len(c2h))
lc = [len(c2h[i]) for i in c2h]
#distribution(lc)
#point = list(h2c.keys())[0]
point = "wx4snhx"
print("hash", point, h2c[point])
lat,lon = h2c[point]
#lat,lon = int(lat+0.5),int(lon+0.5)
points = c2h[(lat,lon)]
for la in [lat-0.01,lat,lat+0.01]:
for lo in [lon-0.01,lon,lon+0.01]:
coord = (la,lo)
points = c2h.get(coord,[])
for p in points:
d = geo_distance(h2c[p],(lat,lon))
print(coord,p,d)
评论列表
文章目录