A4纸分页下载城市百度地图

import math
url = "wget -O test%d%d.png \"http://api.map.baidu.com/staticimage/v2?ak=TyeVKKbcOMcOML13kX6rTFrK¢er=%.2f,%.2f&zoom=14&width=780&height=1024\""
left    = 108.75
right   = 109.14
top     = 34.40
bottom  = 34.16
stepx   = 0.11
stepy   = 0.12

ch = int(math.ceil((right - left) / stepx))
cv = int(math.ceil((top - bottom) / stepy))
for i in range(cv):
    for j in range(ch):
        cmd = url % (i, j, left + j * stepx, top - i * stepy)
        print(cmd)

#wget -O test.png "http://api.map.baidu.com/staticimage/v2?ak=TyeVKKbcOMcOML13kX6rTFrK¢er=108.75,34.40&zoom=14&width=580&height=760"
#wget -O test1.png "http://api.map.baidu.com/staticimage/v2?ak=TyeVKKbcOMcOML13kX6rTFrK¢er=108.83,34.40&zoom=14&width=580&height=760"
#wget -O test2.png "http://api.map.baidu.com/staticimage/v2?ak=TyeVKKbcOMcOML13kX6rTFrK¢er=108.75,34.31&zoom=14&width=580&height=760"
#108.75,34.40  -> 109.14,34.16      delx = 0.08 dely = 0.0

你可能感兴趣的:(A4纸分页下载城市百度地图)