def world_to_image(bbox, size):
px_per_unit = (float(size[<NUM_LIT:0>])/bbox.width, float(size[<NUM_LIT:1>])/bbox.height)<EOL>return lambda x,y: ((x-bbox.xmin) * px_per_unit[<NUM_LIT:0>], size[<NUM_LIT:1>] - (y-bbox.ymin)*px_per_unit[<NUM_LIT:1>])<EOL>
Function generator to create functions for converting from world coordinates to image coordinates