数据似乎在Pseudo Mercator投影(EPSG 3857)中。因此,您应该指定范围 projWin 在那个坐标系中,或者添加 projWinSRS 如果你想在不同的坐标系中提供它们。
projWin
projWinSRS
另外,如果你想 gdal.Translate 要输出到VRT文件,您应该添加 format='VRT 。因为在你的代码片段输出到默认文件格式,这是GeoTIFF。
gdal.Translate
format='VRT
当我假设您的坐标是WGS84(EPSG 4326)时,它定义了斯里兰卡南部海洋上的一个小区域。鉴于数据的性质,这没有多大意义。
如果要读取坐标给出的数组,可以使用:
invrt = 'GHS_BUILT_LDSMT_GLOBE_R2015B_3857_38_v1_0.vrt' outfile = '/vsimem/tmpfile' ds = gdal.Translate(outfile, invrt, projWin=[80.439, 5.341, 81.048, 4.686], projWinSRS='EPSG:4326') data = ds.ReadAsArray() ds = None gdal.Unlink(outfile)
绘制的数组看起来像: