mappers_warp

Crates.iomappers_warp
lib.rsmappers_warp
version0.1.0
created_at2025-09-05 12:25:30.461589+00
updated_at2026-01-16 07:30:56.348542+00
descriptionVery simplistic tool for reprojecting maps, based on GdalWarp
homepage
repositoryhttps://github.com/ScaleWeather/mappers_warp
max_upload_size
id1825432
size135,050
Jakub Lewandowski (Quba1)

documentation

README

Mappers Warp

Github Repository Crates.io License dependency status docs.rs

Very simplistic tool for reprojecting maps, based on the GdalWarp, using mappers for geographic projection.

This tool is effectively a reimplementation of GdalWarp code - all credit for the algorithm creation goes to the GDAL developers.

As you can see, this tool is not very comprehensively documented - if you would like to add something useful to the documentation feel free to open a PR on Github.

Features

  • multithreading - enables parallel functions for Warper. Requires rayon, but can provide significant performance improvements for some rasters.
  • io - enables support for saving and loading Warper from file. Requires rkyv, but can be useful when you want to initialize Warper ahead-of-time.

Example

See more usage examples in integration tests.

use mappers::{
    Ellipsoid, projections::{LambertConformalConic, LongitudeLatitude},
};
use mappers_warp::{CubicBSpline, Warper, RasterBoundsDefinition};
use ndarray::Array2;

let src_proj = LongitudeLatitude;
let tgt_proj = LambertConformalConic::builder()
    .ref_lonlat(80., 24.)
    .standard_parallels(12.472955, 35.1728044444444)
    .ellipsoid(Ellipsoid::WGS84)
    .initialize_projection()?;

let source_bounds =
    RasterBoundsDefinition::new((60.00, 68.25), (31.75, 40.0), 0.25, 0.25, src_proj)?;
let target_bounds = RasterBoundsDefinition::new(
    (2_320_000. - 4_000_000., 2_740_000. - 4_000_000.),
    (5_090_000. - 4_000_000., 5_640_000. - 4_000_000.),
    10_000.,
    10_000.,
    tgt_proj,
)?;

let warper = Warper::initialize::<CubicBSpline, _, _>(
    &source_bounds,
    &target_bounds,
)?;

let source_raster = Array2::zeros((34, 34));
let target_raster = warper.warp_ignore_nodata(&source_raster)?;
Commit count: 54

cargo fmt