Mosaic12

Patches up to 12 rasters into one, which covers all of them, as the tiles of an elevation model delivered in pieces. The output takes the cell size of the first raster. Where the rasters overlap, the merge mode decides the value: the first one (INSERT_ON_NOVALUE), the last one (SUBSTITUTE), or their average or sum.

Parameters

Patches up to 12 rasters into one, which covers all of them, with the cell size of the first one. Where the rasters overlap, the merge mode decides the value.

Toolbox folder: Raster Processing
Status: Certified
Keywords: Mosaic, Patch, Raster
Authors: Andrea Antonello
Class: org.hortonmachine.modules.Mosaic12

Inputs

Parameter

Type

Unit

Default

Description

inMap1

raster file

The first raster to patch: the output takes its cell size.

inMap2

raster file

An optional raster to patch.

inMap3

raster file

An optional raster to patch.

inMap4

raster file

An optional raster to patch.

inMap5

raster file

An optional raster to patch.

inMap6

raster file

An optional raster to patch.

inMap7

raster file

An optional raster to patch.

inMap8

raster file

An optional raster to patch.

inMap9

raster file

An optional raster to patch.

inMap10

raster file

An optional raster to patch.

inMap11

raster file

An optional raster to patch.

inMap12

raster file

An optional raster to patch.

pMergeMode

String

INSERT_ON_NOVALUE

The value where the rasters overlap: INSERT_ON_NOVALUE keeps the first value, SUBSTITUTE the last one, AVG and SUM their average and sum. Allowed values: INSERT_ON_NOVALUE, AVG, SUM, SUBSTITUTE.

Outputs

Parameter

Type

Unit

Description

outMap

output file

The patched raster.

Example

The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:

import org.hortonmachine.modules.ExtractBasin
import org.hortonmachine.modules.Mosaic12
import org.hortonmachine.modules.RasterResizer

// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"

// the polygon of the basin of the outlet of Wateroutlet
var extractBasin = new ExtractBasin()
extractBasin.inFlow = folder + "drain.tif"
extractBasin.pEast = 1639885.0
extractBasin.pNorth = 5110955.0
extractBasin.outBasin = folder + "outlet_basin2.tif"
extractBasin.outVectorBasin = folder + "outlet_basin2.shp"
extractBasin.process()

// the elevation cut to the extent of that basin
var resizer = new RasterResizer()
resizer.inRaster = folder + "dtm_flanginec.tif"
resizer.inVector = folder + "outlet_basin2.shp"
resizer.outRaster = folder + "dtm_outlet_basin.tif"
resizer.process()

// patch it with the elevation cut to the extent of the basin of ExtractBasin by RasterResizer
var mosaic = new Mosaic12()
mosaic.inMap1 = folder + "dtm_basin.tif"
mosaic.inMap2 = folder + "dtm_outlet_basin.tif"
mosaic.outMap = folder + "dtm_mosaic.tif"
mosaic.process()
The elevation cut to the extents of the basins of ExtractBasin and of Wateroutlet, patched into one raster that covers both: the cells outside the two pieces are no-data.

The elevation cut to the extents of the basins of ExtractBasin and of Wateroutlet, patched into one raster that covers both: the cells outside the two pieces are no-data.