Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geopandas空间索引进行GPS路径匹配速度过慢 #1

Open
dickwxyz opened this issue Jun 5, 2019 · 2 comments
Open

geopandas空间索引进行GPS路径匹配速度过慢 #1

dickwxyz opened this issue Jun 5, 2019 · 2 comments

Comments

@dickwxyz
Copy link

dickwxyz commented Jun 5, 2019

虾神您好,我用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)
@allenlu2008
Copy link
Owner

allenlu2008 commented Jun 7, 2019 via email

@dickwxyz
Copy link
Author

dickwxyz commented Jun 8, 2019

绘制边长1000米的栅格,先进行过滤,然后用geopandas进行比配,大概用时15分钟。

@dickwxyz dickwxyz closed this as completed Jun 8, 2019
@dickwxyz dickwxyz reopened this Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants