Raster Tiling

Clips rasters into tiles for machine learning algorithms.


Description

A processing block that splits images into tiles ready for consumption by machine learning algorithms.

See this block on the marketplace.

How it works

The block is agnostic to spatial or spectral resolution, coordinate reference system and data type. This also means that if an input dataset has more than four bands, the output will have the same. Some machine learning algorithms can therefore have problems with the tiles if they only support RGB images.

Augmentation by using offsets is also supported, a mechanism that can be used when training supervised algorithms and effectively creating more training data.

If not enough image pixels are left to create a complete tile (at the right and bottom borders of an image), the missing pixels are filled with NoData pixels.

For change detection purposes, the match_extents parameter is crucial. If the tiling block is provided multiple input images and this option is set, the resulting tiles will have the same extents across all input layers. This is achieved by computing a bounding box that covers all input images, and then filling in the missing pixels of each layer with nodata (0). If the input images have an alpha band, it will set to 255 in the nodata areas.

ParameterOverview
tile_widthinteger / required
The width of the tile, in pixels. The default value is 768.
tile_heightinteger / required
The height of the tile, in pixels. The default value is 768.
match_extentsboolean / required
If true, the tile extents (bounding boxes) of all input layers will perfectly match. The default value is false.
augmentation_factorinteger / required
Factor used to create additional tiles by applying a pixel offset. The default value is 1.
output_prefixstring / required
A prefix of tile names. The default behavior is to use input filename.
discard_empty_tilesboolean / required
If true, tiles that only consist of zeros or nodata, as defined by an alpha band or a set nodata value, will not be returned. The default value is true.
nodatainteger / required
The value representing nodata within each raster band. If not set, defaults to the nodata value of the input raster.

Example

An example using the SPOT 6/7 Display (Streaming) block as a data source and then applying tiling with match_extents.

{
  "oneatlas-spot-aoiclipped:1": {
    "bbox": null,
    "time": null,
    "limit": 3,
    "intersects": {
      "type": "Polygon",
      "coordinates": [
        [
          [18.42631, -33.912732],
          [18.420799, -33.922741],
          [18.44355, -33.924784],
          [18.441069, -33.913781],
          [18.42631, -33.912732]
        ]
      ]
    },
    "zoom_level": 17
  },
  "tiling:1": {
    "tile_width": 768,
    "tile_height": 768,
    "match_extents": true,
    "output_prefix": "",
    "augmentation_factor": 1,
    "nodata": 0
  }
}

Capabilities

Input

Output

To know more please check the block capabilities specifications.