PlaceService.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ugc.aggregator 作者: Dreamcatcher-GIS 项目源码 文件源码
def mutiSearchPlace(self):
        envelope=polygon_target.envelope
        bounds=list(envelope.bounds)
        # ????
        bounds[0] -= 0.02
        parts = 50
        # ?????4?????16???
        boundsList = GeoUtil().getBoundsList(bounds, parts)
        threads = []
        # ???????????16?????????????
        for index in range(0, len(boundsList)/16+1, 1):
            for threadIndex in range(index*16,(index+1)*16):
                if threadIndex < len(boundsList):
                    print 'current bounds ...%s ' % threadIndex
                    subBounds = boundsList[threadIndex]
                    # ?extent???polygon
                    coords=GeoUtil().getPolygonByExtent(subBounds)
                    coords=tuple(coords)
                    isIntersects=Polygon((coords)).intersects(polygon_target)
                    if isIntersects:
                        threads.append(gevent.spawn(self.fetchPlaceDetail, threadIndex%16, subBounds))
            gevent.joinall(threads)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号