Exemplo n.º 1
0
def idw_job(path):

    if all_processed(path):
        return f'{path} processed'

    wbt = WhiteboxTools()
    wbt.verbose = False
    wbt.work_dir = path

    wbt.lidar_idw_interpolation(parameter='elevation',
                                returns='last',
                                resolution=10,
                                weight=1.0,
                                radius=20.0,
                                exclude_cls='3,4,5,6,7,18')

    return f'{path} complete'
Exemplo n.º 2
0
def mosaic(fname, flist, preserve=True, verbose=False):

    print(f'mosaic: {fname} from {len(flist)} frags', flush=True)
    wbt = WhiteboxTools()
    wbt.verbose = verbose

    if len(flist) < 2:
        print('mosaic: less than 2 tifs', fname, flist, flush=True)
        return False

    wbt.mosaic(inputs=';'.join(flist), output=fname, method='nn')

    if not preserve:
        for f in flist:
            try:
                os.remove(f)
            except FileNotFoundError:
                pass

    return True