fmeobjects.FMERasterTools.resampleBySpacing
- FMERasterTools.resampleBySpacing(xSpacing, ySpacing, interpolation, raster, parms)
Performs resampling (both upsampling and downsampling) on a raster using ‘xSpacing’ and ‘ySpacing’.
The X / Y spacing in ground units dictates the desired size of the raster after processing. Valid input values are positive floating point numbers. The new number of rows columns of the raster will be determined based on the input spacing and the extents of the raster in ground coordinates.
- Parameters:
xSpacing (float) – Desired xSpacing of the raster after processing.
ySpacing (float) – Desired ySpacing 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.