77 split raster

Uncomment the following line to install leafmap if needed.
| # %pip install -U leafmap
|
Create an interactive map and add a raster layer to it.
| m = leafmap.Map()
url = "https://opengeos.org/data/raster/cog.tif"
m.add_cog_layer(url, name="COG")
m
|
Split the raster layer into multiple tiles.
| leafmap.split_raster(url, out_dir="tiles", tile_size=(100, 100), overlap=0)
|
Show the tiles.
| leafmap.find_files("tiles", ext=".tif")
|
Merge the tiles into a single raster dataset.
| leafmap.merge_rasters("tiles", output="merged.tif", input_pattern="*.tif")
|