def create_frames(mapfile):
# increment in steps of 3 units from 1 to 35
min_buffer = 1
max_buffer = 35
step = 3
# create a line
line = LineString([(0, 0), (100, 100), (0, 200), (200, 200), (300, 100), (100, 0)])
# set the map extent to this line
mapfile["extent"] = " ".join(map(str, line.buffer(max_buffer*2).bounds))
all_images = []
# create expanding buffers
for dist in range(min_buffer, max_buffer, step):
all_images.append(create_frame(mapfile, line, dist))
# create shrinking buffers
for dist in range(max_buffer, min_buffer, -step):
all_images.append(create_frame(mapfile, line, dist))
return all_images
评论列表
文章目录