def output_tile(quadkey, output_path): tile_path = mapswipe.get_tile_path(quadkey) destination_path = os.path.join(output_path, quadkey + '.jpg') if sys.platform == 'linux' or sys.platform == 'darwin': os.symlink(tile_path, destination_path) else: shutil.copy(tile_path, destination_path)
def pick_from(pool, bing_maps_client): while pool: quadkey = pool.pop() tile_path = mapswipe.get_tile_path(quadkey) if not os.path.exists(tile_path): bing_maps_client.fetch_tile(quadkey, tile_path) if os.path.getsize(tile_path) > 0: return quadkey return None
def cell_renderer(quadkey, solution): retVal = "" retVal = "Quadkey: <a href=\"{}\" target=\"_blank\">{}</a><br>".format( quadkey_to_url(quadkey), quadkey) if solution is not None: retVal += "Officially: {}<br>".format(solution.ground_truth[quadkey]) retVal += "Predicted class: " + solution.predicted_class( quadkey) + "<br>" retVal += "<img align=\"center\" src=\"mapswipe_working_dir/{}\"/><br>".format( os.path.relpath(mapswipe.get_tile_path(quadkey), os.path.join(str(Path.home()), '.mapswipe'))) if solution is not None: retVal += "PV:" + str(solution.prediction_vectors[quadkey]) return retVal