def create_imagefile(options, filename, latlon, ground_width, path_objs, mission_obj, fence_obj, width=600, height=600):
    '''create path and mission as an image file'''
    mt = mp_tile.MPTile(service=options.service)

    map_img = mt.area_to_image(latlon[0], latlon[1],
                               width, height, ground_width)
    while mt.tiles_pending() > 0:
        print("Waiting on %u tiles" % mt.tiles_pending())
        time.sleep(1)
    map_img = mt.area_to_image(latlon[0], latlon[1],
                               width, height, ground_width)
    # a function to convert from (lat,lon) to (px,py) on the map
    pixmapper = functools.partial(pixel_coords, ground_width=ground_width, mt=mt, topleft=latlon, width=width)
    for path_obj in path_objs:
        path_obj.draw(map_img, pixmapper, None)
    if mission_obj is not None:
        for m in mission_obj:
            m.draw(map_img, pixmapper, None)
    if fence_obj is not None:
        fence_obj.draw(map_img, pixmapper, None)
    cv.CvtColor(map_img, map_img, cv.CV_BGR2RGB)
    cv.SaveImage(filename, map_img)
def create_imagefile ( options , filename , latlon , ground_width , path_objs , mission_obj , fence_obj , width = 600 , height = 600 ) : mt = mp_tile . MPTile ( service = options . service ) map_img = mt . area_to_image ( latlon [ 0 ] , latlon [ 1 ] , width , height , ground_width ) while mt . tiles_pending ( ) > 0 : print ( "Waiting on %u tiles" % mt . tiles_pending ( ) ) time . sleep ( 1 ) map_img = mt . area_to_image ( latlon [ 0 ] , latlon [ 1 ] , width , height , ground_width ) pixmapper = functools . partial ( pixel_coords , ground_width = ground_width , mt = mt , topleft = latlon , width = width ) for path_obj in path_objs : path_obj . draw ( map_img , pixmapper , None ) if mission_obj is not None : for m in mission_obj : m . draw ( map_img , pixmapper , None ) if fence_obj is not None : fence_obj . draw ( map_img , pixmapper , None ) cv . CvtColor ( map_img , map_img , cv . CV_BGR2RGB ) cv . SaveImage ( filename , map_img )
create path and mission as an image file