问题描述
我想使用Python基于Geohashes创建一个北京的网格。我尝试使用 scikit-mobility 库,但我需要使用类似 python-geohash 库的东西来提高准确性。
import skmob
from skmob.tessellation import tilers
import pandas as pd
from skmob.preprocessing import filtering
df1 = pd.read_csv('./allPechino.csv')
tdf = skmob.TrajDataFrame(df1,latitude = 'latitude',longitude = 'longitude',user_id='taxi_id',datetime='date_time')
tessellation = tilers.tiler.get("squared",base_shape="Beijing,China",meters=15000)
# counting movements that start and end in the same tile
fdf = tdf.to_flowdataframe(tessellation=tessellation,self_loops=True)
print(fdf.head())
我创建了一个 OD-matrix 使用 scikit-mobility 库,这就是结果
origin destination flow
101 101 3
101 116 1
101 117 1
103 103 1151
103 104 9
之后我在 folium 地图上绘制 FlowDataFrame
m= fdf.plot_flows(flow_color='red')
m
现在我的问题是:如何使用 python-geohash 库做同样的事情?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)