def main(): for tile,points in groupby(read_points(stdin), lambda x: x[0]): try: zoom = get_zoom(tile) map = init_map(zoom, points) map.zoom_all() im = mapnik.Image(256,256) mapnik.render(map,im) emit(tile, encode_image(im)) except Exception as e: print_status("Error while rendering tile %s: %s" % (tile,e)) raise e
def main(): for tile, points in groupby(read_points(stdin), lambda x: x[0]): try: zoom = get_zoom(tile) map = init_map(zoom, points) map.zoom_all() im = mapnik.Image(256, 256) mapnik.render(map, im) emit(tile, encode_image(im)) except Exception as e: print_status("Error while rendering tile %s: %s" % (tile, e)) raise e
def main(): for geom, population in read_feature(stdin): for lng, lat in sample_geometry(geom, population): for key, val in make_kv(lat, lng): emit(key, val)