def download_tiles_multiprocess(tile_names_list, out_dir, num_processes):
    download_task_list = []
    dsm_dir = os.path.join(out_dir, 'dsm')
    os.makedirs(dsm_dir, exist_ok=True)
    dtm_dir = os.path.join(out_dir, 'dtm')
    os.makedirs(dtm_dir, exist_ok=True)
    for tile_name in tile_names_list:
        dsm_url = 'https://download.pdok.nl/rws/ahn3/v1_0/05m_dsm/R_{}.ZIP'.format(tile_name)
        dtm_url = 'https://download.pdok.nl/rws/ahn3/v1_0/05m_dtm/M_{}.ZIP'.format(tile_name)
        download_task_list.append([tile_name, dsm_dir, dsm_url])
        download_task_list.append([tile_name, dtm_dir, dtm_url])
    print('Dowloding {} tiles'.format(len(download_task_list)))
    p = Pool(num_processes)
    p.starmap(download_and_extract, download_task_list)
    p.close()
    p.join()
def download_tiles_multiprocess(tile_names_list, out_dir, num_processes):
    download_task_list = []
    dsm_dir = os.path.join(out_dir, 'dsm')
    os.makedirs(dsm_dir, exist_ok=True)
    dtm_dir = os.path.join(out_dir, 'dtm')
    os.makedirs(dtm_dir, exist_ok=True)
    for tile_name in tile_names_list:
        dsm_url = 'https://download.pdok.nl/rws/ahn3/v1_0/05m_dsm/R_{}.ZIP'.format(tile_name)
        dtm_url = 'https://download.pdok.nl/rws/ahn3/v1_0/05m_dtm/M_{}.ZIP'.format(tile_name)
        download_task_list.append([tile_name, dsm_dir, dsm_url])
        download_task_list.append([tile_name, dtm_dir, dtm_url])
    print('Dowloding {} tiles'.format(len(download_task_list)))
    p = Pool(num_processes)
    p.starmap(download_and_extract, download_task_list)
    p.close()
    p.join()