예제 #1
0
    # wait for pending rendering jobs to complete
    queue.join()

    for i in range(num_threads):
        downloaders[i].join()

    qWrite.put(None)
    qWrite.join()
    write_thread.join()


if __name__ == "__main__":
    starttime = datetime.datetime.now()

    path = "./tmp/"
    if not os.path.exists(path):
        os.makedirs(path)

    minZoom = 10
    maxZoom = 10
    #湖南省
    bbox = (108.790841, 24.636323, 114.261265, 30.126363)
    # bbox = (108.790841, 24.636323, 108.81265, 24.86363)
    #高德卫星影像
    tile = Tile.CTile("webst04.is.autonavi.com/appmaptile?style=6")
    #高德栅格底图
    tile = Tile.CTile("http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8")
    download_tiles(tile, bbox, "./out/", minZoom, maxZoom)

    endtime = datetime.datetime.now()
    print str(endtime-starttime)
예제 #2
0
            if not os.path.isdir(tile_dir + zoom + '/' + str_x):
                os.mkdir(tile_dir + zoom + '/' + str_x)
            for y in range(int(px0[1] / 256.0), int(px1[1] / 256.0) + 1):
                if (y < 0) or (y >= 2**z):
                    continue
                str_y = "%s" % y
                tile_uri = tile_dir + zoom + '/' + str_x + '/' + str_y + '.png'
                t = (name, tile_uri, x, y, z)
                queue.put(t)
                sumOfProcessed += 1
                print "processed : %s%%" % str(
                    (sumOfProcessed * 1.0) / sum * 100)

    # Signal render threads to exit by sending empty request to queue
    for i in range(num_threads):
        queue.put(None)
    # wait for pending rendering jobs to complete
    queue.join()
    for i in range(num_threads):
        downloaders[i].join()


if __name__ == "__main__":
    minZoom = 16
    maxZoom = 16
    #湖南省
    bbox = (108.790841, 24.636323, 114.261265, 30.126363)
    #高德卫星影像
    tile = Tile.CTile("webst04.is.autonavi.com/appmaptile?style=6")
    download_tiles(tile, bbox, "./out/", minZoom, maxZoom)
예제 #3
0
    for i in range(num_threads):
        downloaders[i].join()

    qWrite.put(None)
    qWrite.join()
    write_thread.join()


if __name__ == "__main__":
    starttime = datetime.datetime.now()

    path = "./tmp/"
    if not os.path.exists(path):
        os.makedirs(path)

    minZoom = 16
    maxZoom = 16
    #湖南省
    bbox = (108.790841, 24.636323, 114.261265, 30.126363)
    # bbox = (108.790841, 24.636323, 108.81265, 24.86363)
    #高德卫星影像
    #tile = Tile.CTile("webst04.is.autonavi.com/appmaptile?style=6")
    #高德栅格底图
    #tile = Tile.CTile("webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8")
    #谷歌卫星影像
    tile = Tile.CTile("mt0.google.cn/maps/vt?lyrs=s%40748&hl=zh-CN&gl=CN")
    download_tiles(tile, bbox, "./hunan_yingxiang_16.tar", minZoom, maxZoom)

    endtime = datetime.datetime.now()
    print str(endtime - starttime)
예제 #4
0
    qWrite.put(None)
    qWrite.join()
    write_thread.join()


if __name__ == "__main__":
    starttime = datetime.datetime.now()

    path = "./tmp/"
    if not os.path.exists(path):
        os.makedirs(path)

    minZoom = 10
    maxZoom = 17
    #湖南省
    bbox = (108.790841, 24.636323, 114.261265, 30.126363)
    # bbox = (108.790841, 24.636323, 111.526053, 30.126363)
    # bbox = (111.526053, 24.636323, 114.261265, 30.126363)
    #高德卫星影像
    #tile = Tile.CTile("webst04.is.autonavi.com/appmaptile?style=6")
    #高德栅格底图
    tile = Tile.CTile(
        "webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8")
    #谷歌卫星影像
    # tile = Tile.CTile("mt0.google.cn/maps/vt?lyrs=s%40748&hl=zh-CN&gl=CN")

    download_tiles(tile, bbox, "./hunan_10_17.tar", minZoom, maxZoom)

    endtime = datetime.datetime.now()
    print str(endtime - starttime)