TransWikia.com

Python: gdal.Warp how to crate mosaic and don't save?

Geographic Information Systems Asked by anotherquesrionplease on March 31, 2021

I would like create a mosaic but I don’t want to save it, just have in memory or as a variable and then close. I want to do that because I would like to cut out the roof of the buildings and sometimes buildings stand on 2 raster files.

from osgeo import gdal

a = 'C:/Users/ja/Inne/Desktop/73776_931613_M-34-46-C-d-3-3.tif'
b = 'C:/Users/ja/Inne/Desktop/73776_933044_M-34-58-A-b-1-1.tif'

files_to_mosaic = [b, a] 

g = gdal.Warp('C:/Users/ja/Inne/Desktop/output.tif', files_to_mosaic, format="GTiff",
              options=["COMPRESS=LZW", "TILED=YES"])

With the code I can make mosaic and then save it but I don’t want to save that. How can I solve that?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP