def concurrentRequest(self):
# ???
envelope=polygon_target.envelope
bounds=list(envelope.bounds)
# ????
bounds[0] -= 0.02
parts = 4
# ?????4?????16???
boundsList = GeoUtil().getBoundsList(bounds, parts)
threads = []
for index in range(0, len(boundsList), 1):
print 'current bounds ...%s ' % index
subBounds = boundsList[index]
# ?extent???polygon
coords=GeoUtil().getPolygonByExtent(subBounds)
coords=tuple(coords)
isIntersects=Polygon((coords)).intersects(polygon_target)
if isIntersects:
threads.append(gevent.spawn(self.fetchPlace, index, subBounds))
gevent.joinall(threads)
评论列表
文章目录