【发布时间】:2023-02-10 20:43:39
【问题描述】:
我正在处理一些 TIFF 图像,我想向现有图像添加另一个波段。
这是我用来读取图像的代码:
# Read the image
image = rasterio.open('input.tiff')
with rasterio.open("input.tiff", 'r+') as src:
crs = rasterio.crs.CRS({"init": "epsg:4326"})
src.crs = crs
使用此代码,我可以更改 CRS:这是图像的元数据:
{'driver': 'GTiff',
'dtype': 'uint8',
'nodata': None,
'width': 524,
'height': 499,
'count': 3,
'crs': CRS.from_epsg(4326),
'transform': Affine(1.0, 0.0, 0.0,
0.0, 1.0, 0.0)}
我想改变数数值从 3 到 4。
我在用着光栅.
提前致谢。
【问题讨论】:
标签: python-3.x rasterio satellite-image sentinel2