0
点赞
收藏
分享

微信扫一扫

GIS实战应用案例100篇(三十四)-拼接2020globeland30

小禹说财 2022-04-18 阅读 91

2020globeland30

产品介绍详见http://www.globallandcover.com/Page/sysFrame/dataIntroduce.html?columnID=81&head=product&para=product&type=data

总的来说,主要数据是含有投影的GeoTIFF格式,一共966个,每个tif连同对应的坐标信息文件、分类影像接图表文件、元数据文件压缩成一个zip,然后所有zip再压缩成一个zip。整个压缩包有7.18G大。

目的

将966个tif拼接成全球经纬度数据。

过程

计划用gdal读取tif然后xarray拼接,如果gdal能直接读取压缩包里指定数据当然是最好,可惜不能。那么就只把tif解压出来,“没用的”其他文件就不必浪费心情解压出来了。

解压

 1import zipfile
 2from os.path import exists, basename
 3from os import makedirs
 4
 5
 6globeland30_zippath = 'G:/GEO_DATA/landcover/globeland30/2020LC030.zip'
 7globeland30_tifdir = 'G:/GEO_DATA/landcover/globeland30/tif'
 8if not exists(globeland30_tifdir):
 9    makedirs(globeland30_tifdir)
10globeland30_zipfile = zipfile.ZipFile(globeland30_zippath)
11for zipinfo in globeland30_zipfile.filelist:
12    a_zipfile = zipfile.ZipFile(globeland30_z
举报

相关推荐

0 条评论