PySparkDemo
PySparkDemo copied to clipboard
geopandas空间索引进行GPS路径匹配速度过慢
虾神您好,我用12的方法做GPS路径匹配,数据量有1.7亿,500个点用时1s,5000个点用时10s,50000点用时100s,请问有更为快速的方法吗? 保存GPS的hdfs中分了200个block,运行程序只读取一个block里的数据,是不是这个原因导致程序运行过慢?
def PP(p,line):
for i in range(len(line)):
geom = ogr.CreateGeometryFromWkt(str(line['geometry'][i]))
t = geom.Contains(ogr.CreateGeometryFromWkt('POINT('+str(p[5])+' '+str(p[6])+')'))
if t:
return (i,p[0],p[16],1)
break
else:
return ('other','1',1,1)
data1 = data.rdd.map(lambda a:PP(a,road1))
r = data1.take(500000)
没试过做路径匹配,不确定是否可以更优
卢 萌
Email:[email protected] mailto:[email protected]
个人技术博客:http://blog.csdn.net/allenlu2008
技术公众号:虾神daxialu
发件人: [email protected] [email protected] 代表 dickwxyz 发送时间: 2019年6月5日 19:33 收件人: allenlu2008/PySparkDemo [email protected] 抄送: Subscribed [email protected] 主题: [allenlu2008/PySparkDemo] geopandas空间索引进行GPS路径匹配速度过慢 (#1)
虾神您好,我用12的方法做GPS路径匹配,数据量有1.7亿,500个点用时1s,5000个点用时10s,50000点用时100s,请问有更为快速的方法吗?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/allenlu2008/PySparkDemo/issues/1?email_source=notifications&email_token=ABHZ4BHIWUPNZKG6BEGN7B3PY6P6BA5CNFSM4HTV2GF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXX32DA , or mute the thread https://github.com/notifications/unsubscribe-auth/ABHZ4BAXOMBCXQX4QOLXX2LPY6P6BANCNFSM4HTV2GFQ .
绘制边长1000米的栅格,先进行过滤,然后用geopandas进行比配,大概用时15分钟。