Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with rasterio.open(final_list[0]) as src0:
- meta = src0.meta
- with rasterio.open('stack.tif', 'w', **meta) as dst:
- for id, layer in enumerate(final_list):
- with rasterio.open(layer) as src1:
- #the .astype(rasterio.int16) forces dtype to int16
- dst.write_band(id + 1, src1.read(1).astype(rasterio.int16))
- ...
- Metadata:
- AREA_OR_POINT=Area
- Image Structure Metadata:
- ...
- Band 1 Block=3596x1 Type=Int16, ColorInterp=Gray
- NoData Value=-9999
- Band 2 Block=3596x1 Type=Int16, ColorInterp=Undefined
- NoData Value=-9999
- ...
- ...
- Metadata:
- Band_1=Band 1 Reflectance
- Band_2=Band 2 Reflectance
- Band_3=Band 3 Reflectance
- Band_4=Band 4 Reflectance
- Band_5=Band 5 Reflectance
- Band_6=Band 7 Reflectance
- Band_7=Band 6 Temperature
- Band_8=Fmask
- Image Structure Metadata:
- ...
- Band 1 Block=300x1 Type=Int16, ColorInterp=Undefined
- NoData Value=-9999
- Band 2 Block=300x1 Type=Int16, ColorInterp=Undefined
- NoData Value=-9999
- ...
Add Comment
Please, Sign In to add comment