Bootstrap

GDAL 处理VIIRS图像(一)

使用gdal.warp对viirs图像多个波段进行重投影输出的函数

import os
import numpy as np
from osgeo import gdal,osr

def viirs_Warp(OutPath,viirsFilePath,shpFilePath=''):
    '''
    viirs图像多波段重投影与shp区域裁剪
    :param OutPath:输出tif图像的文件夹
    :param viirsPath: 输入的viirs图像路径
    :param cutlinePath: 裁剪对应区域的文件路径
    :return:
    '''
    ori_dataset = gdal.Open(viirsFilePath)
    sub_datasets = ori_dataset.GetSubDatasets()

    dt_nLw_443 = gdal.Open(sub_datasets[8][0])
    dt_nLw_486 = gdal.Open(sub_datasets[9][0])
    dt_nLw_551 
;