ImageMosaicCreator

Creates the index of a GeoTools image mosaic in a folder of georeferenced images, as the tiles of an orthophoto or of an elevation model. The folder can then be read as one raster, by GeoServer and by the modules that read image mosaics, without merging the tiles in a single file.

Details

The index is a shapefile named as the folder, with the footprint of each image and its file in the location field, next to a properties file with the configuration of the mosaic and a sample_image.dat: the images stay as they are. They need to share the coordinate reference system, the number of bands and the data type, while their resolutions can differ: an image of another kind is left out of the index.

The index is made only once: if the folder has one already, it is used as it is, and the images added later are not in it. To index them, the shapefile, the properties file and sample_image.dat need to be deleted first.

Parameters

Creates the index of a GeoTools image mosaic over the georeferenced images of a folder.

Toolbox folder: Raster Processing
Status: Certified
Keywords: Imagemosaic, Mosaic, Tiles, Raster
Authors: Andrea Antonello
Class: org.hortonmachine.modules.ImageMosaicCreator

Inputs

Parameter

Type

Unit

Default

Description

inFolder

folder

The folder containing the images to mosaic.

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.gears.utils.files.FileUtilities
import org.hortonmachine.modules.ImageMosaicCreator

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

// a folder with the two elevation models cut by RasterResizer for Mosaic12
var tiles = folder + "dtm_tiles/"
new File(tiles).mkdirs()
FileUtilities.copyFile(folder + "dtm_basin.tif", tiles + "dtm_basin.tif")
FileUtilities.copyFile(folder + "dtm_outlet_basin.tif", tiles + "dtm_outlet_basin.tif")

// creates dtm_tiles.shp, the index of the footprints, and dtm_tiles.properties in it
var creator = new ImageMosaicCreator()
creator.inFolder = tiles
creator.process()
The footprints of the two elevation models in the index of the mosaic.

The footprints of the two elevation models in the index of the mosaic, dtm_tiles.shp.