fmeobjects.FMERasterTools.resampleByRowCol
- FMERasterTools.resampleByRowCol(numRows, numCols, interpolation, raster, parms)
Performs resampling (both upsampling and downsampling) on a raster using number of rows and columns.
The number of rows and number of columns dictate the desired size of the raster after processing. Valid input values are positive integers. The new X / Y spacing of the raster will be determined based on the input rows and columns and the extents of the raster in ground coordinates.
- Parameters:
numRows (int) – Desired number of rows of the raster after processing.
numCols (int) – Desired number of columns of the raster after processing.
interpolation (int) –
Interpolation of the raster. Choose one of:
FME_INTERPOLATION_NEARESTNEIGHBOR
FME_INTERPOLATION_BILINEAR
FME_INTERPOLATION_BICUBIC
FME_INTERPOLATION_AVERAGE4
FME_INTERPOLATION_AVERAGE16
FME_INTERPOLATION_SOURCE
raster (FMERaster) – Raster to be processed.
parms (dict[str, str]) – (Optional) Specifies name-value pairs representing additional parameters.
Possible parms are :
Valid arguments for this option are floating point values. If specified, the x origin of the resampled raster is adjusted by the provided value. The sample locations used when determining the data values of the output raster will also be offset by this value. This is useful when a raster needs to be accurately aligned to a reference grid. In order to more quickly adjust a raster origin without modifying data values, use the
offset
function.
This parameter is identical to resample_SnapOffsetX, except that it adjusts the y origin.
- Return type:
- Returns:
The raster after resampling.
- Raises:
FMEException – An exception is raised if an error occurred.