Skip to main content

Module resampling

Module resampling 

Source
Expand description

Raster resampling algorithms

This module provides various resampling algorithms for changing the resolution or dimensions of raster data while maintaining spatial accuracy.

§Algorithms

  • Nearest neighbor (fastest, preserves exact values)
  • Bilinear interpolation (smooth, good for continuous data)
  • Bicubic interpolation (higher quality, smoother)
  • Lanczos resampling (highest quality, most expensive)

§Example

use oxigdal_algorithms::resampling::{ResamplingMethod, Resampler};
use oxigdal_core::buffer::RasterBuffer;
use oxigdal_core::types::RasterDataType;

// Create a resampler
let resampler = Resampler::new(ResamplingMethod::Bilinear);

// Resample a raster buffer
let src = RasterBuffer::zeros(1000, 1000, RasterDataType::Float32);
let dst = resampler.resample(&src, 500, 500)?;

Structs§

BicubicResampler
Bicubic interpolation resampler
BilinearResampler
Bilinear interpolation resampler
LanczosResampler
Lanczos resampler with configurable lobe count
NearestResampler
Nearest neighbor resampler
Resampler
Generic resampler that can use any resampling method

Enums§

ResamplingMethod
Resampling methods