Downsampling
The Downsampling operator decreases raster resolution by sampling values of an input raster.
If queried with a resolution that is finer than the input resolution, downsampling is not applicable and an error is returned.
Inputs
Section titled “Inputs”The Downsampling operator expects exactly one raster input.
Resolution
Section titled “Resolution”The target resolution can be specified either as an explicit Resolution (in pixel units)
or as a Fraction that scales the input resolution.
// Scale the input resolution by a factor of 2 in both x and y directionsDownsamplingResolution::Fraction(Fraction { x: 2.0, y: 2.0 })// Use an explicit resolution of 200×200 pixel unitsDownsamplingResolution::Resolution(SpatialResolution { x: 200.0, y: 200.0 })Parameters
Section titled “Parameters”| Name | Type | Description | Examples |
|---|---|---|---|
| samplingMethod | DownsamplingMethod | Downsampling method. | |
| outputResolution | DownsamplingResolution | Target output resolution. | |
| outputOriginReference | null or Coordinate2D |
Sources
Section titled “Sources”| Name | Type | Description |
|---|---|---|
| raster | RasterOperator | An operator that produces raster data. |
Examples
Section titled “Examples”{ "type": "Downsampling", "params": { "samplingMethod": "nearestNeighbor", "outputResolution": { "type": "fraction", "x": 2, "y": 2 } }, "sources": { "raster": { "type": "MultiBandGdalSource", "params": { "data": "sentinel-2-l2a_EPSG32632_U8_20" } } }}