Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Changelog

All notable changes to rwarp. Dates are when the change reached main.

0.5.1 (unreleased)

Added

  • rwarp::view: which chunks, at which level, a view on a screen needs from a chunked source with resolution levels (a Zarr with multiscales, a COG with overviews), as a value, with no I/O. plan_view takes a View (extent and screen size), a Source (per level a geotransform, a size and a chunk shape; whether its CRS wraps, and its poles) and the CRS transforms, and returns a ViewPlan: chunk keys nearest the centre first, and per screen tile the level it needs. The screen is planned in tiles of 64 pixels, each with its own level from the local scale (the Jacobian of screen pixel to source, Need::Area or Need::Shortest; gdalwarp's -ovr AUTO rule per tile) and its own footprint, unwrapped across the source's seam; a tile holding a pole takes the full row of longitudes; tiles at the limb of a globe are sampled a pixel at a time. ViewOptions::max_chunks and max_cells are a budget, met by moving the outermost tiles coarser; ViewPlan::diff gives what to fetch and drop on a pan. plan_single_box is the one box, one level rule most viewers use, for comparison: for a polar view of a global lon/lat pyramid it asks for 6.5 times the cells, across 180 degrees 8.5 times. The cases are data (tests/fixtures/view/cases.json) for other planners to run. With serde, the inputs and the plan derive it. In rwarp-wasm: planView, planSingleBox, planViewWith.

  • Footprint::Adaptive { densify, tolerance } and WeightOptions::refine_tolerance (with_refine_tolerance): the exact footprint with each segment of the outline bisected where the transform bends it, until it is within the tolerance of the true curve (curvilinear stage 5a, #38). It is d3-geo's adaptive resampling through bigcurve, one transformer call per level. The tolerance is in source pixels, or in world units for a source with cells (geolocation, mesh, SetTransformer). The error follows the tolerance, and the points grow as its inverse square root, as a fixed densify's do, but they go only where edges bend. Where the transform is affine the weights are Exact { densify }'s bit for bit. Tiles, threads and warp() against apply agree bit for bit as before. Footprint is non_exhaustive, so the new variant is not breaking.

  • QuadMesh::burn_from and Rectilinear::burn_from (and _par): polygons and points in another CRS, their edges straight there, densified into the grid's world by bigcurve to a tolerance in world units (curvilinear stage 5b, #38). Each edge is first cut at the grid's tallest cell, and the polygons are cut to the grid's y range in their CRS, as MeshSet::burn does for a band, so a polygon round the far pole doesn't come out inside out. With a declared period, rings are unwrapped across the seam, and one round a pole is refused. The area burned converges on the closed form at the tolerance's rate, with the points growing as its inverse square root.

  • mesh::PolyMesh, a mesh of polygonal faces (ICON's triangles, MPAS's hexagons, a UGRID or ESMF mesh; new from compressed rows, from_padded from a padded table), and conservative weights between it and a grid both ways: weights_onto (grid to mesh) and weights_to (mesh to grid), one table of overlaps turned round (conservative stage 5, #39). Each face is measured as exact_weights measures a destination pixel: its edges densified (or refined by bigcurve) through the transformer into the grid's pixels, under the grid's measure, across a seam and round a pole. Faces that share an edge get bitwise the same points on it, so they tile the grid. With a period (with_period), edges go the shorter way round. Against ESMF (Cartesian, hexagons and triangles over part of a grid) the weights agree to 6e-14 both ways.

  • PolyMesh::with_great_circles: edges on great circles, as ICON's and MPAS's are, nodes in longitude and latitude (conservative stage 5b, #39). Each edge is cut at densify equal angles, or refined by bigcurve's great-circle model; one across the equator is cut there first, where its curve in longitude and latitude turns and refinement can't see it. A node on a pole joins its edges along their meridians, whatever longitude it is written with. Each face's area converges on its spherical excess, at the tolerance's rate (densify's inverse square), and the faces tile a global grid at every tolerance. Against ESMF's spherical maps (a geodesic mesh and its dual, both ways, with a global 5 degree grid) the faces' areas agree to 8e-8; the weights differ by the grid's cells, which rwarp bounds by parallels and ESMF by great circles (S to 3.8e-3).

  • PolyMesh::weights_onto and weights_to with a grid whose cells are in its world coordinates: geolocation arrays (GenImgGeolocTransformer), a QuadMesh (MeshTransformer) or a MeshSet (SetTransformer), each with destination geotransform WORLD_GT (conservative stage 5c, #39). Each face is measured as such a source measures a destination pixel: its outline in the source's world, walked onto its cells, across a seam and round a pole; for a set, in each band's world, left out of one where it comes out inside out, judged against the face's own turn. Onto a curvilinear mesh the fractions are the faces' clipped overlaps to 1.1e-13; onto a set the faces tile every cell to 1e-12. The world-cell measure is factored out of the exact footprint's lattice (WorldCells); warp and weights hashes are unchanged.

  • PolyMesh::weights_onto_par and weights_to_par: on threads, a transformer built on each, the faces in ranges taken in turn and joined in order, the serial table bit for bit (conservative stage 5, #39). A geodesic mesh of 20480 great-circle triangles onto a global 0.25 degree grid, refined: 0.52 s serial, 0.12 s on 8 threads; to the grid 0.63 s and 0.25 s. weights_to now groups its entries by cell with a counting sort (same order, faster).

  • Second-order conservative remapping (conservative stage 6a, #40): ESMF's conserve_2nd.

    • What it does: each source cell's value becomes a plane over the cell, and each overlap takes the plane's mean over it.

    • The API: WeightOptions::with_moments(true) records each overlap's first moments (Weights::moment), from controlledburn's CoverageWindow::set_moments. Weights::apply_second_order remaps a field with them, and Weights::second_order folds the gradients into one table, as ESMF's weight files hold it.

    • As ESMF does it: the gradient comes from the cell's eight neighbours by Green's theorem, zero where they don't surround the cell. It is centred on the part of the cell the table covers, so the integral is conserved exactly under DestArea. apply_second_order takes the gradients from the field, so neighbours without data drop out of them.

    • Checks: fields linear in source pixels come out exact to 1e-14, planar and on the sphere. Halving the cell size quarters the error on a quadratic. The folded table is ESMF's to 6e-14 for a grid onto a grid (new fixtures <case>.cart2.txt).

    • One difference from ESMF: ESMF centres each overlap on the mean of its polygon's vertices, not its centroid. So where a projected grid cuts general polygons from a lon/lat one, ESMF is off by up to 0.035 on a linear field and rwarp is exact. Given ESMF's vertex means, rwarp gives ESMF's table to 1e-12.

    • Scope: any grid source, a grid onto a mesh, and a PolyMesh's faces onto a grid.

    • Sources with world cells (6b): geolocation arrays, a QuadMesh through MeshTransformer, a MeshSet (through SetTransformer or weights_to), and a grid onto a PolyMesh (weights_onto) or a set (weights_onto). The planes are in the cells' index space under the walk's equal-area map, where the overlaps are measured (decided 2026-11-19). The moments there are exact centroids: they are the overlaps clipped against each cell's four triangles to 3e-15. A field linear in the grid's indices comes out exact to 1e-14. A world quadratic on a curved grid is second order (its error falls 3.9 times as the cells halve) though not exact, as the map is affine only on each quarter of a cell. Weights::second_order(src, valid, areas) takes the window's world cell areas for such a source, from the new weights::source_cell_areas, as a gradient draws on cells the table may not reach. An empty table takes them too (it can't say what its source was).

    • A PolyMesh's faces as sources (6c): PolyMesh::weights_to (and _par) records moments, about each overlap's grid cell corner, and the new PolyMesh::apply_second_order and PolyMesh::second_order remap and fold with them. A face's plane is in the grid's space, where its overlaps are measured (its pixels, or a curvilinear grid's indices), as decided on 2026-11-19. Its neighbours are the faces sharing a node, as in ESMF, each centred on the part of it the table covers. A field linear in the grid's space comes out exact to 3e-14, in pixels, on the sphere and in a curvilinear grid's indices (first order is off by 1.2 to 2.3). On a quadratic, halving mesh and grid divides the error by 3.9. At a seam without a period in the table (see below for one with it), the gradients are one-sided: a face the seam cuts is first order (its cells aren't one piece), and a neighbour across the seam is left out (its cells aren't next to the face's). Without moments the tables are as before, bit for bit.

    • A limiter (6d), opt-in: ApplyOptions::with_limiter(Limiter::BarthJespersen) (new weights::Limiter, Off by default, as in ESMF). Barth and Jespersen's: each source cell's gradient scaled so its plane, at each of its overlaps' centroids, stays within the values of the cell and its neighbours. Next to a sharp front, values overshot their sources by 0.1 to 7 without it (fronts over grid cells, world cells and a mesh's faces); with it, each destination value (FracArea) is within its sources' and their neighbours' values to 1e-15, band by band, cells without data left out. It is a factor per cell, so the integral is conserved as before. Inside a window a linear field comes out as without it; on a smooth sine it costs 16 to 72% in rms (planes at extrema are flattened too) and stays 7 to 49 times closer than first order. It depends on the field, so it is for apply_second_order only; a folded table can't hold it. Overlaps under 1e-12 of their cell (rounding, 2 to 4% of a table's entries, centroids up to 45 cells off) are left out of the factor and take their cell's value. ApplyOptions is non_exhaustive, so the new field is not breaking.

    • On the sphere, against ESMF (6d): new fixtures <case>.sph2.txt, ESMF's spherical conserve_2nd, for the three second-order grid cases and both sphere meshes both ways (tests/esmf_second_order_sphere.rs). ESMF's method works in three dimensions, rwarp's in longitude and latitude, so the comparison is of accuracy: each against exact cell means in its own cells (great circles for ESMF's, parallels for rwarp's). A grid onto a grid: both second order, 15 to 1,300 times closer than first inside, close to each other for lon/lat onto lon/lat and rwarp 19 times closer projected. A grid onto a mesh: rwarp 5 to 17 times closer than ESMF everywhere (ESMF's vertex means). A mesh onto a grid: below 60 degrees of latitude rwarp is 1.7 to 4.9 times closer, next to the grid's seam (with its period, below) and away from it. Nearer the poles, where a plane in longitude and latitude fits less well, ESMF is 1.6 times closer for the geodesic mesh and rwarp 2.5 times for its dual.

    • Across a global grid's seam: a table made with moments on a grid that wraps round the globe every whole number of its columns (Transformer::source_wrap) records that number in the new Weights::period. That covers exact_weights, PolyMesh::weights_onto and PolyMesh::weights_to, and their _par forms. It is None without moments, for world cells, or for a period that isn't whole. Second order then takes neighbours across the seam:

      • a grid cell on the seam takes the cells at the grid's other end;
      • a mesh face the seam cuts has its cells taken across it to meet, so it has a plane;
      • a face's neighbour across the seam is moved by whole periods to it;
      • a face whose cells take every column (round a pole) is first order and no one's neighbour.

      With the seam on the far side of the globe, the same mesh comes out the same to 1e-10 (its faces' refinement differs by as much in first order); without the period, by up to 0.22. Within 15 degrees of the seam and below 60 degrees of latitude, a mesh onto a global grid had been near first order (rms 5.3e-2 and 8.1e-2). It is now 9.2e-3 and 1.4e-2, as away from the seam, against ESMF's 1.6e-2 and 6.0e-2 (tests/second_order_period.rs, tests/esmf_second_order_sphere.rs). Weights is non_exhaustive, so the field isn't breaking, and tables without it come out as before, bit for bit.

    • Inside, relative to the polygon: a cell's centre is outside its neighbours' polygon if it is past an edge by more than ESMF's 1e-14, or by an angle of more than 1e-9 seen from the edge's start. A centre on an edge by symmetry (as for a geodesic mesh's faces at a pole) had been in or out as the faces' measure rounded. So a whole face's plane came and went with where the seam was. The ORCA2 and second-order bitwise checks and the ESMF comparisons are unchanged.

    • Dependency: controlledburn 0.3.3 (from 0.3.1), for set_moments.

Changed

  • Decision N2 (#44): the equal-area split's fallback for a non-convex cell whose balanced line misses its kernel (the best kernel point, the cell flagged inexact) now panics in a debug build, naming the decision, and runs only in a release build. A property test searches for such a cell (59,754 simple non-convex cells in four variants, all exact), as do eORCA1's and ORCA2's sets (6 non-convex cells, all exact).
  • Decisions C1 to C4 (#48 to #51) are recorded: u32 indices per axis, FracArea the default normalisation (now said prominently, with what to ask for to compare with ESMF's DSTAREA default), the lattice shared by warp() and exact_weights, and the measure on the source side only, said in the docs.
  • Decision N5 (#47), built: the curvilinear walk (QuadMesh::burn, cover_ring, ring_to_index, and a mesh source's exact footprint) keeps plain f64 orientation tests, made consistent where near-degenerate input meets them. A ring vertex within 1e-12 (index space) of its cell's corner or side is put on it, and a crossing within 1e-12 of an edge's end is put at the end, so a ring through the mesh's own corners covers its cells exactly once and their neighbours not at all (it gave a neighbour a sliver up to 2e-16 before). Each segment is walked from its lexicographically smaller end, so a side two polygons share has bitwise the same path from both (they could differ by 3e-12 in coverage). Property tests (tests/mesh_walk_degenerate.rs, 71,000 checks, 290,000 at twenty times the cases) search vertices on and within rounding of corners, sides, spokes and centres, segments through them, along sides and at shallow angles, against the world clip, complementary tilings and the ring reversed. No failure is left, so adaptive predicates aren't needed. Output changes only in rounding: on ORCA2 as a set, warp() and weights_onto are bit for bit the same, and weights_to loses 560 entries of at most 1.4e-14 (1,171 at densify 4) and moves no other by more than 1.8e-12.

Fixed

  • The curvilinear walk (QuadMesh::burn, cover_ring, ring_to_index) no longer loses a segment that starts an ulp off a corner (found by the N5 property tests). Such a point can be owned, to rounding, by a cell whose bounding box it is just outside, and the flood of cells along the segment then stopped at that cell. The segment was taken as outside the mesh, and the ring closed by a boundary arc, covering cells it doesn't reach. The owner now counts as touched. Likewise a segment that enters the mesh within rounding of an outer corner (an ulp off it, next to 0) was missed: whether it meets an outer side is now decided by the orientation tests' signs, not a box test they could contradict. And a segment that leaves just past an outer corner now leaves through the wall, not from inside the mesh by up to 1e-12 of its length: short pieces of it are kept.
  • ChunkOptions::split_antimeridian with the fill ratio split (with_fill_ratio_split) no longer loses that split on a window that spans the source width with no jump in source x (#76), such as a narrow source the target covers whole. Such a window was marked for a split at the jump, its fill ratio replaced, and with no jump found it was split for memory only. Now the jump is looked for first, and a window not split at one, for want of a jump or because splitting saves nothing (round a pole), takes GDAL's rule with its own fill ratio. So vapour's sst.tif (143 x 286, 140 to 150 E) to EPSG:3031 at 10 km is gdalwarp's 9 chunks, not 1 (a new gdalwarp fixture, narrow_stere_bilinear), and every gdalwarp fixture's plan is gdalwarp's with the option on. Plans that split at a jump are unchanged. rwarp-r gets this with its next crate update.

0.5.0 (2026-11-18)

Whole ocean-model grids as mesh::MeshSet (regridding to and from them, burning onto them, warping from them, NEMO's halos), curvilinear sources measured in their own world coordinates, and threads for warps, chunked warps and weights.

Upgrading from 0.4:

  • No public item of 0.4.1 is removed or has a new signature. Transformer gains source_cells and source_wrap, both with defaults.
  • Values change for the exact footprint (Footprint::Exact, exact_weights) over geolocation sources, now measured in the source's world coordinates, and across a geographic source's antimeridian and round its poles (see below). Point kernels, the GDAL box footprint and affine sources are unchanged bit for bit.
  • Mesh burns change on meshes with cells of no area inside them, and for a ring touching a mesh at one point (see Fixed). Other meshes give the same records bit for bit.
  • New blanket impls: Transformer for &T, and CrsTransform for Box<C> and &C. A crate that implements either trait for a reference or a box of its own type conflicts with them; drop that impl.
  • mesh is unstable (decision N4): it may break at a 0.x minor release.

Changed

  • The exact footprint (Footprint::Exact, exact_weights) over a geolocation source measures in the source's world coordinates (#36, stage 3 of design/curvilinear-frontend.md). Each destination pixel's outline goes to source world coordinates and is walked onto the source window's cells under the equal-area map. Each source pixel is the quadrilateral through its corners' positions. So weights are fractions of each cell's world area, and Average and Mode weight each source pixel by its world area. Before, the outline went through the inverse geolocation transform and was measured in source pixel space.
    • Effect: for a destination pixel inside the source, weight times cell area now sums to the outline's area to 2e-13 (relative). The old measure was off by up to 3e-3 on a polar-sector grid, and 6e-3 on a curved longitude/latitude grid to polar stereographic.
    • Across the antimeridian (#72): with lon_wrap, the arrays' longitudes are unwrapped by continuity, so cells across the seam are whole. Each outline is unwrapped too and walked at each whole turn that reaches the cells, and one that goes round a pole is closed along latitude 90 or -90. The same swath stored with its seam in different places gives the same weights (to 1e-11, the rounding of areas at longitude 180), and weight times cell area sums to the outline's area across the seam.
    • Fallback: arrays with a missing sample, arrays that fold, and, with lon_wrap, arrays whose longitudes don't unwrap consistently (a swath over a pole) or span more than 360 degrees keep the old measure, decided once per set of arrays (GeolocArrays::world_cells).
    • Values change for exact-footprint warps and weights from geolocation sources. Point kernels, the GDAL box footprint and affine sources are unchanged bit for bit. rwarp-r doesn't expose geolocation sources.
    • Speed: 3 to 9 times the old measure at densify 2 (4 to 6 microseconds a pixel in the timings for #36).
  • exact_weights_with's CellWeights gains src_area, each entry's source cell measure.
  • The mesh walk (QuadMesh::ring_to_index, and so burn, burn_par and cover_ring) is 4 to 30 times faster, with the same output bit for bit (checked over 17,806 rings). The changes:
    • outer sides are found through a bucket index, instead of every outer side being tested for each segment that leaves the mesh;
    • a cell is clipped only if the segment meets its bounding box;
    • the flood's buffers are reused along a ring. Natural Earth 10m land onto the warped 1440 x 720 mesh of examples/mesh_burn_par.rs now takes 0.24 s with burn (1.15 s before), and 0.06 s at 8 threads (0.23 s).
  • Decision N1 (#43): coverage uses the equal-area map on every mesh. QuadMesh::ring_to_index, burn, burn_par and cover_ring no longer refuse a mesh built with CellMap::Bilinear; they give the same records as on a CellMap::EqualArea mesh. A mesh's CellMap is now the map of its point methods only (to_index, to_world, local, world), Bilinear by default for GDAL parity.
  • mesh says what "unstable" means (decision N4): the module may break at a 0.x minor release, not at a patch release. Its docs show one mesh per scan for a swath whose scans overlap (decision N3; a doctest), and QuadMesh::from_corners says that overlap keeping orientation (a row or column stored twice, such as an ocean model's halo) isn't detected yet.

Fixed

  • QuadMesh::ring_to_index (and so burn, burn_par, cover_ring) on meshes with cells of no area inside them, such as a T-point pivot of a tripolar grid, a collapsed column, or a pole row in a polar projection (stage 4b, #37). Four fixes:

    • A ring crossing such a cell jumps in index space at one world point. It was joined straight to the next piece's end, misplacing the following cell's coverage. It's now linked through the collapsed cell, and, where that cell is on the boundary, across the walls. A jump the walk can't follow is an error, not a wrong ring.
    • The equal-area split of a cell with a side of no length (a triangle) put its centre on the collapsed corner and its unit centre outside the unit square, so it was inexact and placed index points outside the cell. It's now exact.
    • A vertex at a collapsed corner took a position from another of the cell's triangles.
    • A ring starting on a corner whose owner had no area was taken as starting outside the mesh.
    • Bounded meshes without such cells give the same output bit for bit.
    • Also: a cell's area that is zero to rounding is now zero, so a cell collapsed onto a line, with its corners not quite on it, no longer takes an orientation and gets the mesh refused as folded.
  • QuadMesh::ring_to_index for a ring that touches the mesh at a single boundary point from outside: it left and re-entered at the same point, and the walk closed it along the whole boundary, so burn and cover_ring covered every cell. Now the ring misses the mesh. A ring around the whole mesh that touches it at one point still covers it.

  • The exact footprint (Footprint::Exact, exact_weights) across a geographic source's antimeridian and around a pole (#36, the cases #11's comparison found). A destination pixel whose outline crosses the source's seam is unwrapped and measured at each whole-period offset that reaches the source; one that goes around a pole is closed along the pole's row. On a global 1 degree grid to 41 x 41 polar stereographic pixels, the weights no longer depend on where the source's seam is (to 5e-14), every pixel's weights sum to its outline's area, and the pole pixel's converge to the polar cap at second order in densify; before, weights across the seam were off by up to 0.92.

Added

  • mesh::MeshSet: a whole curvilinear grid as rectangular pieces, each a QuadMesh in the projection of its band of rows, for an ocean model's whole global grid (stage 4g of design/curvilinear-frontend.md, #37).

    • MeshSet::from_cf_bounds(ncol, nrow, xb, yb, halo, bands, droppable) projects each Band to its own world. It leaves out cells that are bow-ties there, turned the wrong way or overlapping others, where droppable allows (land), and refuses them otherwise. The rest are covered by Pieces, so a cell left out is a hole.
    • weights_to and weights_onto give conservative weights from and onto the whole grid as one Weights in the file's numbering, from exact_weights through a MeshTransformer or MeshTarget per piece. Each piece is measured only over the pixels it reaches.
    • For ORCA: bands in north-polar and south-polar LAEA on the model's sphere, both equal-area, so areas add up across them. Where they meet the cells bow apart, a gap of about dlam^2 / (6 dphi) of a cell (under 1% at 20 S on ORCA2).
    • Checks (tests/mesh_set.rs): an analytic global tripolar grid with damaged land, conservation to 7e-15, the gap within its bound, the rest unchanged by the damage. On CMIP6's eORCA1 and ORCA2 whole (in scratch): every ocean cell kept, 716 and 801 land cells left out, to 1 degree in about 1 s each.
    • MeshSet::burn(geoms, bands, tolerance, opts) (stage 4h) burns polygons and points in the bounds' coordinates (longitude and latitude) onto the set. It returns controlledburn's tables in the set's numbering, as fractions of each cell's area.
      • Edges are straight in the bounds' coordinates. bigcurve densifies them into each band's world to tolerance (world units).
      • Each band takes only the polygons' part within its cells' y range, so a polygon round the far pole isn't turned inside out.
      • Rings are split where a cut at 180 or along a pole brings them back onto themselves.
      • Checks: boxes on the analytic grid against closed-form areas, to 8e-8. On eORCA1 and ORCA2 (scratch): a whole-world box covers every kept cell, and boxes agree with weights_onto to 8e-6. Natural Earth's 10 m countries burn in 0.7 to 1.1 s.
      • Each piece walks only what can reach it. Tiles mark where its cells are, so polygons elsewhere are skipped and runs of edges away from it cut short, with the same result bit for bit. On ORCA2 the countries went from 3.0 s to 1.1 s.
      • Each ring's edges are tested against a piece 32 at a time by their box, one by one only near it, and far runs are cut short a chunk at a time, again bit for bit. On one thread ORCA2's countries take 0.96 s at 1 m (1.1 s before) and 4.6 s at 0.01 m (5.6 s).
      • MeshSet::burn_par(geoms, bands, tolerance, opts, threads) gives the same records on several threads. Pieces filter, walk and burn their polygons in parallel. Projection stays on the calling thread, since a band's transform needn't be thread-safe. On 8 threads ORCA2's countries take 0.44 s.
      • MeshSet::burn_par_with(geoms, bands, tolerance, opts, threads, to_world) projects on the threads too: each thread builds its own copy of band k's transform with to_world(k). The records are the same again. On 8 threads ORCA2's countries take 0.18 s at 1 m and 0.92 s at 0.01 m (2.2 s with burn_par).
    • New dependency: bigcurve 0.3 (pure Rust, no dependencies of its own, builds for wasm).
  • MeshSet::from_file_layout, to_file_layout and fill_halo: fields between the file's grid (halo and all) and the set's numbering. MeshSet keeps the file's size and halo (file_size, halo).

    • from_file_layout drops the halo, for a SetTransformer's source buffer.
    • to_file_layout puts a field back with the halo masked by a fill. Where the fold runs through the last row's centres (T cells at a T-point pivot), the two halves of a model cell give it their mean by area.
    • fill_halo(file, nbands, point) writes NEMO's halo for a set with a NEMO halo: the cyclic columns and the north fold's rows, for a field at the grid's T, U, V or F points (Stagger), as NEMO 4.0 writes them (3.6 takes the last column of U and F points at an F pivot from the wrong column). On eORCA1 and ORCA2, cell centres taken to the set and back, halo filled, match the file's to 2e-16 in every row but the first, and the positions of all four points from the T cells' bounds come back exactly.
    • to_file_layout_vector and fill_halo_vector, for components of a vector in the grid's directions: the fold's copies change sign (NEMO's psgn = -1), and a fold row's halves are turned round before their mean. Components east and north are scalars here. On both files, components along each cell's own directions come back to 1e-16, halo and all.
  • Sets of NEMO's U, V and F cells: Halo::nemo(pivot, cells), with Pivot and the cells' Stagger (Halo::NEMO_F_PIVOT and NEMO_T_PIVOT are the T cells'). V and F cells at a T pivot drop the last two rows; the fold runs through the centres of the last row kept for T and U cells at a T pivot and for V and F cells at an F pivot. Halo::nemo records the grid (the field nemo: Option<Nemo>), for fill_halo's pivot and to pair a fold row's halves by NEMO's mirror for the cells' point. On both files, each point's cells cover the cap north of 60 N to 2e-7 of its area.

  • MeshSet::weights_to_par and weights_onto_par: weights_to and weights_onto on up to threads threads, the same tables bit for bit. Pieces with at least 1 / threads of the set's cells are measured one after another, each on every thread (exact_weights_par, a transformer per thread from the closure); the rest at once, one a thread, the most cells first; merged in the pieces' order. To 1 degree at densify 8: eORCA1's weights_to 3.0 s on one thread, 0.42 s on 8.

  • weights::exact_weights_par: exact_weights on up to threads threads, the same table entry for entry and bit for bit.

    • Each thread builds its own transformer and takes bands of the target's rows into a table of its own, with one lattice moved to each band; the tables are joined in row order.
    • A 0.1 degree global source to 1000 x 1000 south polar stereographic at densify 2 (6.7 M entries) through libproj: 3.0 s on one thread, 0.58 s on 8. Through a SetTransformer, ORCA2 to 1 degree at densify 8: 2.3 s and 0.35 s.
  • plan::warp_chunks_par: warp_chunks on up to threads threads, with the same values bit for bit.

    • Each thread builds its own transformer, and takes bands of each chunk's rows from one queue, about four bands a thread over the plan. So a plan of one chunk runs on every thread, and one of many warps several chunks at once.
    • A chunk's source window is copied when its first band starts (borrowed when it is whole rows of the buffer) and dropped after its last. Bands go into the target in the plan's order, as on one thread (the two chunks of an antimeridian gap share a target window).
    • A 0.1 degree global grid to 4000 x 4000 south polar stereographic pixels through libproj, 8 chunks: bilinear 1.48 s on one thread, 0.26 s on 8; cubic 3.09 s and 0.46 s.
  • Targets are filled with their nodata by copying (slice::repeat), not pixel by pixel. warp_chunks of a one-chunk plan to 16 million pixels took 0.94 s on one thread, 1.03 s before.

  • warp::warp_par and warp_to_par: warp and warp_to on up to threads threads, with the same values bit for bit.

    • Each thread builds its own transformer with a closure, as GDAL's -wo NUM_THREADS clones one a thread (a libproj transformer can't be shared). It takes bands of the target's rows from one queue.
    • What a warp works out once (the cutline's density over the source, the kernel scale over the whole target) is worked out once. The exact footprint's lattice is built once a thread and moved to each band.
    • A 0.1 degree global grid to 2000 x 2000 south polar stereographic pixels through libproj: bilinear 0.48 s on one thread, 0.08 s on 8; the exact-footprint average 3.4 s and 0.45 s.
    • Transformer for &T, so a Sync transformer serves every thread as || Ok(&t).
  • mesh::SetTransformer: a MeshSet as a warp source (stage 4i of design/curvilinear-frontend.md, #37), for warp() and exact_weights from a whole ocean grid in pieces with every method.

    • Source pixels are the set's cells in its numbering, so a field on the whole grid (less its halo) is one source buffer.
    • Area methods with the exact footprint walk each destination pixel's outline in every band's world onto each piece it reaches, into one reduction. Average is weights_to and apply bit for bit, and on ORCA2 to 1 degree 0.88 s against 1.21 s. An outline turned inside out round a polar projection's far pole isn't measured in that band.
    • Point kernels map into the set's index space through the piece that holds the point, and read neighbours across pieces and bands.
  • SourceCells gains worlds, dst_to_world_in and sheets (with SourceSheet), defaulted to one world and one sheet, for sources whose cells are in several worlds. MeshTarget passes them on. Sources that are one sheet warp and weigh as before, bit for bit.

  • CrsTransform for Box<C> and &C (C: CrsTransform + ?Sized), so crs_pair's boxed transforms go where a T: CrsTransform is asked for, such as MeshSet::burn_par_with's to_world.

  • mesh::MeshTarget: a QuadMesh as a warp target, for regridding onto a curvilinear grid given by its corners, such as an ocean model's tripolar grid (stage 4f of design/curvilinear-frontend.md, #37).

    • How: target pixel (col, row) is mesh cell (row, col). A target pixel goes to the mesh's world coordinates and then through an inner transformer to the source. from_grid(src_crs, src_gt, src_size, mesh, mesh_crs) makes that a GenImgProjTransformer, wrapping a lon/lat source's longitudes as gdalwarp does. new(mesh, inner) takes any transformer whose destination geotransform is mesh::WORLD_GT: geolocation arrays, or another mesh (MeshTransformer), for mesh to mesh.
    • What it gives: exact_weights measures each cell as a target pixel in the source's space, under any measure (lonlat_measure for areas on the sphere), across a lon/lat source's seam and over its pole. warp() regrids onto the mesh with any kernel; point kernels sample each cell's centre.
    • Checks (tests/mesh_target.rs): in one plane, the overlaps are the mesh source's transposed (2e-14), and mesh to mesh is symmetric. From a global lon/lat grid every cell is covered in full and the seam's position doesn't matter. warp() is Weights::apply bit for bit.
    • Against ESMF onto the tripolar cap (tests/esmf_tripolar.rs, new onto_tripolar fixtures from gen.py; the existing fixtures are unchanged bit for bit): Cartesian in the plane to rounding (3e-13); spherical recorded, S up to 3e-2 on the cap's smallest cells and 3e-3 over cells more than 100 km across.
  • A declared period for coordinates that jump at the seam, such as longitude: QuadMesh::with_period and Rectilinear::with_period (stage 4e of design/curvilinear-frontend.md, #37).

    • Polygons: burn, burn_par and cover_ring take each polygon at each whole period at which it overlaps the grid, so polygons from -180 to 180 burn onto a grid from 0 to 360, and across its seam.
    • Points: locate, locate_all, to_index and Rectilinear::cell find a point at any whole period.
    • A mesh source: MeshTransformer over a mesh with a period takes target pixels across its seam, and round a pole (closed along latitude 90 or -90).
    • mesh::unwrap_grid and mesh::unwrap_bounds make longitudes stored with a jump ([-180, 180), [0, 360)) continuous; from_corners and from_cf_bounds name them when they refuse such corners.
    • Refused: a cell half a period wide or more (round a pole, as at a tripolar grid's north), and a mesh that goes round more than once. find_overlap includes the period once it is declared.
    • Checks (tests/mesh_period.rs): generator 5, a regular global grid with its columns rotated, against controlledburn's regular burn (bitwise at f32); the same weights wherever a mesh's seam is, for a lon/lat destination and a polar one whose centre pixel holds the pole; warp() against Weights::apply.
    • Meshes without a period are unchanged bit for bit.
  • mesh::MeshTransformer: a QuadMesh as a warp source, for data with one value per cell on a curvilinear grid given by its corners, such as an ocean model's tripolar grid (stage 4d of design/curvilinear-frontend.md, #37).

    • Constructors: new(mesh, mesh_crs, dst_gt, dst_crs) with the CRS backend, or with_backend with your own CrsTransforms.
    • What it gives: it reports the mesh as the source's cells (Transformer::source_cells). So exact_weights gives conservative weights from the mesh, as fractions of each cell's world area across the seam and fold, and warp() with Footprint::Exact regrids with the area methods.
    • Point kernels go through the mesh's cell map (QuadMesh::to_index).
    • Checks: warp() with Average is Weights::apply(FracArea) bit for bit, every cell's weights sum to 1, and source windows tile the mesh (tests/mesh_transformer.rs).
  • QuadMesh::window: a window's cells as a mesh of their own.

  • ESMF on a tripolar grid (stage 4c of design/curvilinear-frontend.md, #37; tests/esmf_tripolar.rs). The weights come from exact_weights through MeshTransformer, on an analytic tripolar cap with a seam into one pole and an F-point fold. They are compared on two destinations: a grid in the cap's own plane, and lon/lat up to the pole.

    • Cartesian ESMF in the plane: the weights agree to rounding (3e-14).
    • Spherical ESMF: the differences are great-circle edges, recorded as ceilings. S differs by up to 2.6e-3 and areas by up to 9e-4, and the area difference falls with the square of cell size.
    • The NEMO layout of the same grid gives the same mesh to the bit.
    • Fixtures come from tests/fixtures/esmf/gen.py, which now takes case names. Its existing fixtures are unchanged bit for bit.
  • QuadMesh::from_cf_bounds: a mesh from each cell's own four vertices, CF bounds (lon_bnds(j, i, 4)) or SCRIP corners (grid_corner_lon(grid_size, 4)), with a Halo of rows and columns dropped first (stage 4b, #37, decision N3).

    • Vertex order: found from the data (CF's or any rotation or reflection of it).
    • Shared corners: neighbours must share them, to a thousandth of a cell.
    • Overlap: refused, as a halo left in gives.
    • NEMO: Halo::NEMO_F_PIVOT and Halo::NEMO_T_PIVOT are the ORCA layouts as CMIP6 files have them (the last two columns, the first row and the last row), for the T cells; Halo::nemo gives the cells round the grid's other points (above). At a T pivot the row the fold runs through is halved, and its model cells are two mesh cells.
    • Real data: checked on IPSL's eORCA1 and ORCA2. Areas agree with areacello to 1e-4 in total, and a cap over the fold is covered to 1e-10 of its area. Both files have land cells (eORCA1 south of 76 S, flattened by a north-polar projection; corrupt bounds in ORCA2) that are refused, so for now those rows are dropped.
  • QuadMesh::find_overlap: two cells that overlap, a point inside one owned by the other too, for copies that keep orientation, which from_corners doesn't check.

  • QuadMesh::ring_to_index, and so burn, burn_par and cover_ring, cross outer walls that meet in the world: a periodic grid's seam (column line ncol on column line 0) and a tripolar grid's fold (the last row line on itself, corner i on corner ncol - i), with nothing declared (stage 4a of design/curvilinear-frontend.md, #37). Give the grid's corners in a projection in which it is one sheet: for an ocean grid's tripolar north, Lambert azimuthal equal-area on the north pole, whose planar areas are true areas. The walls need to agree only to rounding.

    • Before: a ring crossing a seam or fold was joined across the mesh in index space, and cells along the crossing were off by up to a whole cell.
    • Bounded meshes: the same output bit for bit. Tested against the per-cell world clip on an annulus, a fold and a tripolar disk (tests/mesh_glued.rs).
    • Not yet: coordinates that jump at the seam (longitudes 360 apart).
  • Transformer::source_cells and transform::SourceCells: a transformer reports a source whose pixels are cells in its own world coordinates. It provides the map from destination pixels to source world coordinates (dst_to_world) and the cells of a source window (mesh), for the exact footprint. Default None. GenImgGeolocTransformer with geolocation arrays on the source side, and GeolocArrays on its own, report it when GeolocArrays::world_cells() is Ok; ApproxTransformer passes it through, with dst_to_world unapproximated. SourceCells::lon_wrap (default false) says world x is longitude that wraps.

  • GeolocArrays::world_cells, whether the exact footprint measures a source with these arrays in world coordinates (and if not, why), and GeolocArrays::window_mesh, a source window's cells.

  • Weights::src_cell_area: each entry's source cell area, for a geolocation source (empty otherwise, and not serialised when empty). Weights::src_area uses it.

  • Transformer::source_wrap and transform::SourceWrap: a transformer reports a source that wraps in longitude (its period in source pixels and the rows of the poles), for the exact footprint. Default None; GenImgProjTransformer reports it for a north-up geographic source of at most 360 degrees wrapped around a centre longitude (after with_source_size), and ApproxTransformer passes it through.

0.4.1 (2026-11-16)

Added

  • QuadMesh::burn_par and Rectilinear::burn_par: the mesh burns on up to threads threads (0 for all available), with the same result as burn, record for record. The ring walk into index space runs on contiguous chunks of the geometries of about equal vertex counts, taken in turn by the threads, and the burn uses controlledburn's burn_par. Natural Earth 10m land (6,837 polygons, 446,175 vertices) onto a warped 1440 x 720 mesh: 1.16 s with burn; 0.58 s, 0.31 s and 0.24 s at 2, 4 and 8 threads, and no faster past 8, as one geometry is never split (the largest, 19% of the vertices, takes 0.33 s alone). examples/mesh_burn_par.rs times it.

0.4.0 (2026-11-12)

Changed

  • controlledburn 0.3.1 (from 0.2.4). Breaking for rwarp because its types are in rwarp's API (weights::Measure, and Geometry, BurnOptions and BurnResult in QuadMesh::burn and Rectilinear::burn). Options are #[non_exhaustive] in 0.3, so build them with BurnOptions::coverage() and the with_* methods. A multi-part geometry now gets one record per cell in a mesh burn (merge_parts, on by default); BurnOptions::parity keeps one per part. Cutlines burn each polygon separately and are unchanged. Otherwise the test suite gives the same results as on 0.2.4.

0.3.3 (2026-11-12)

Changed

  • ChunkOptions::split_antimeridian no longer reads the whole source width for the columns at the jump (the gap). Each gap pixel needs only one edge of the source, so the gap becomes two chunks on the same target window, one source window at each edge, sampled every half pixel and padded for the gap's own kernel scale. A 384x384 Lambert azimuthal target centred on 180 degrees over GEBCO at overview 3 reads 200,600 source pixels instead of 2,257,200, with the same values (exact transformer; nearest, bilinear and cubic; Int16, Float32 and Byte).
  • The split is kept only when it reads under half of the full-width window, so a target around a pole (where every longitude is needed) keeps GDAL's plan, and it no longer depends on the fill ratio split being on.
  • warp_chunks places only the pixels a chunk wrote (not equal to the fill, NaN equal to NaN), through the new plan::merge_tile. For chunks that don't overlap this is the plain copy it was.

0.3.2 (2026-11-04)

Added

  • The curvilinear front end, stage 2 of design/curvilinear-frontend.md (unstable): QuadMesh::ring_to_index walks a world ring into the mesh's index space, cutting each segment at every cell side and split spoke it crosses (Cyrus-Beck clipping per triangle over a flood of the cells it passes, so vertices, corners and centres on a segment need no special case). A cut point is placed by its parameter along the edge's canonical direction, so rings sharing an edge get bitwise the same point. Stretches outside the mesh are replaced by the boundary arc whose loop with the excursion does not wind around the mesh; a ring around the whole mesh gives its outline. QuadMesh::burn burns polygons (holes, multipolygons) and points through controlledburn with the mesh's own (row, col) and fractions of each cell's world area; QuadMesh::cover_ring does one small ring through a reused CoverageWindow. mesh::Rectilinear is the same for grids given by column and row edges (cut at every wall, piecewise linear per axis). Checked against world-space clipping of every cell (Sutherland-Hodgman per split triangle) on rotated, jittered, non-convex, polar, sheared and flipped meshes with polygons crossing the boundary, holes and vertices steered onto corners and centres; against the affine burn for a rotated grid; and rectilinear against the mesh, all to 2e-6 (controlledburn's f32 fractions). Lines and approx mode are refused for now. (2026-11-01)
  • mesh module, stage 1 of design/curvilinear-frontend.md (unstable): QuadMesh holds a curvilinear grid as straight-edged quadrilateral cells (from_corners, from_centres), refuses bow-ties and folds, and maps between world coordinates and index space with CellMap::Bilinear (GDAL's model; equal to GeolocArrays::geo_to_pixel with corner samples, to 1e-9) or CellMap::EqualArea (four triangles per cell with matching area shares, so index-space area fractions are world-area fractions; checked to 1e-9 on jittered, non-convex, polar and sheared grids, where the bilinear measure is off by more than 1e-3). Every point has at most one owning cell: side orientations are computed once in a canonical direction, and points on a shared wall go to the low-index cell. locate walks from a hint and falls back to CSR buckets built on first use; locate_all returns every owner (for checks). No CRS: builds with --no-default-features. (2026-10-31)
  • A spherical measure for conservative weights (stage 3a of design/conservative.md): WeightOptions::with_measure with weights::lonlat_measure(src_gt) measures areas on the sphere for a source on a regular longitude/latitude grid, through controlledburn's Measure::CosLatitude (closed-form edge integrals of cos(lat); the cell partition and conservation are unchanged). Weights records the measure, Weights::src_area(k) gives an entry's source cell measure, and normalised, dst_covered and apply weight overlaps by it; for the default planar measure every cell is 1 and results are unchanged, bit for bit. Exact against closed-form lon/lat box overlaps on the sphere (to 1e-14). Needs controlledburn 0.2.4. (2026-10-29)
  • ESMF oracle suite (stage 2 of design/conservative.md, tests/esmf.rs): six cases, each against ESMPy 8.9.1's first-order conservative weights in Cartesian source pixel space (rwarp's cell definition: equal to about 1e-12) and on the sphere with great-circle edges (differences recorded as ceilings to shrink). Fixtures from tests/fixtures/esmf/gen.py, run in ghcr.io/hypertidy/gdal-r-esmf by .github/workflows/esmf-fixtures.yml. (2026-10-29)

Changed

  • The serde feature also enables controlledburn's, for Measure in WeightOptions and Weights. (2026-10-29)

0.3.1 (2026-10-28)

Added

  • Longitude wrapping of a geographic source, GDAL's CENTER_LONG: GenImgProjTransformer::with_source_size lets the transformer wrap source longitudes around the source raster's centre as gdalwarp does (InsertCenterLong, OGRProjCT), so a source stored as 170..190, -190..-170 or 0..360 is found by a target crossing 180 degrees. CenterLong (Auto, the default; Off; At(lon), #[non_exhaustive]) with with_center_long, with_target_extent for gdalwarp's -te, center_long(), source_center_long for GDAL's centre, and crs::is_geographic_degrees. A transformer built without with_source_size wraps nothing, as before. Checked against GDAL 3.14.0dev on 11 cases across 180 degrees (LAEA, Mercator, polar stereographic, lon/lat targets; chunked and whole): centres, exact transformer points, chunk lists and every output pixel, with both CRS backends. The LAEA chunk fixtures are back across 180 degrees. The proj feature now also depends on proj-sys (already a dependency of proj), to ask PROJ whether a CRS is geographic.
  • weights module: conservative remapping weights from the exact footprint, as values (stage 1 of design/conservative.md). exact_weights returns Weights, one entry per overlapping (target cell, source cell) pair with full-grid indices and the overlap as an unrounded f64 fraction of the source cell, plus each target cell's outline area in source pixel space (dst_area, NaN where it failed). Weights::normalised gives ESMF's S under Normalization::FracArea or DestArea; Weights::apply applies the weights to one or more bands, skipping source nodata; Weights::esmf_row_col gives ESMF/SCRIP's 1-based flattened indices. exact_weights_with streams them per target cell. WeightOptions (densify, target offset for tiling, drop and snap tolerances, f32 rounding; WeightOptions::warp_compatible), ApplyOptions and GridWindow, all #[non_exhaustive] with builders; serde derives behind serde. apply(FracArea) with warp-compatible weights reproduces warp() with Footprint::Exact and Average bit for bit. warp() shares the lattice and per-pixel coverage step and its output is unchanged. (2026-10-28)
  • GDAL's backmap geolocation inverse, as an option beside the quad index: GeolocOptions::with_inverse(GeolocInverse::Backmap) (GeolocInverse: QuadIndex, the default; Backmap; BackmapEstimate for GDAL_GEOLOC_USE_MAX_ACCURACY=NO; #[non_exhaustive]), with with_backmap_oversample (GEOLOC_BACKMAP_OVERSAMPLE_FACTOR) and GeolocArrays::backmap_grid. Ported from GDAL 3.14 in its arithmetic order (float32 backmap, GDALFillNodata hole filling, the spiral search), by way of wxylib's wxy-warp (geoloc.rs, GDAL 3.12; the geolocation code is unchanged since), adding PIXEL_OFFSET / STEP. Checked against GDAL 3.14.0dev on 9 new cases (swath by centres and by corners, lon/lat and polar stereographic targets, a polar ring and a swath across the antimeridian, holes in the arrays with source nodata, overlapping scans): success and position at every target pixel, the backmap's estimate, and 24 warps (near, bilinear, cubic; -et 0 and 0.125) identical to gdalwarp, every pixel, with proj4rs and the fixtures' PROJ (with an older libproj, nearest identical and interpolated values within 2e-8 relative). Where the two inverses differ, and why, is in the curvilinear guide. (2026-10-28)

Changed

  • The chunk fixtures' special points are computed as GDAL computes them for a geographic source (not reprojected; see ChunkOptions::special_points). No chunk list changes.
  • warp() does GDAL's GWKAdjustSrcOffsetOnEdge: when a corner of the source buffer fails to transform forward and a sample point lands on an invalid source pixel whose corners fail too, a valid neighbour (right, below, left, above) is used instead. This changes output only where the transformer has holes or edges inside the source, as geolocation arrays with missing samples do (12 of 4560 pixels in the holes test case, now identical to gdalwarp). warp() therefore calls the transformer source to destination too, for such pixels only. Point methods; GDAL's variant for alpha and cutline densities is not reproduced. (2026-10-28)
  • The geolocation swath fixture is regenerated with GDAL 3.14.0dev (was 3.8.4): positions moved by up to 3e-8 pixels (PROJ), nothing else.
  • controlledburn 0.2.3 (corner passes, near-coincident edges, exact centre ties). The cutline centre rule now matches gdalwarp on centres exactly on diagonal edges: 5 pixels of the mask_diamond_tie fixture that differed now agree. They came from controlledburn 0.2.2's rounded intercepts; the parity page had put them down to GDAL.

0.3.0 (2026-10-28)

This release changes the API: options types are #[non_exhaustive].

Changed

  • warp() retries a sample point that lands less than one pixel outside the source buffer by transforming it again on its own, as GDAL does (GWKCheckAndComputeSrcOffsets). Through ApproxTransformer that is exact, so interpolation error no longer drops pixels at the edge of a chunk's source window; with an exact transformer nothing changes. Point methods only (nearest, bilinear, cubic, cubic spline, lanczos), as in GDAL. (2026-10-28)
  • WarpOptions, GeolocOptions and AverageThresholds are #[non_exhaustive], as are ResampleAlg, KernelScaling, Footprint, BandNodata, Nodata, DstNodata, DataType and GeolocConvention. New options and methods can then come in minor releases. Outside rwarp, build options with WarpOptions::new(alg) and the with_ methods (GeolocOptions::default().with_convention(..), and so on) instead of struct literals, and add a _ arm when matching on the enums. Fields stay public for reading and assignment.

Added

  • WarpOptions::new and with_ builder methods on WarpOptions, GeolocOptions and AverageThresholds.
  • plan module: plan_chunks and ChunkPlanner give gdalwarp's chunk list as values (WarpPlan of Chunks: target window, source window, fill ratio, kernel scale), following GDAL 3.14's CollectChunkList and ComputeSourceWindow exactly: warp memory limit (-wm) and per-pixel cost, fill ratio splits, OPTIMIZE_SIZE on target blocks, special points, the forward probe, SAMPLE_GRID, SAMPLE_STEPS, SOURCE_EXTRA. ChunkOptions (builders, #[non_exhaustive]); ChunkOptions::gdalwarp for gdalwarp's planning exactly; an optional round-trip check for backends that do not fail at a projection's antipode; the antimeridian split of 0.2's collect_chunk_list as split_antimeridian. warp_chunks warps a plan from a source buffer in memory. Ported from wxylib's wxy-warp (chunked.rs). (2026-10-28)
  • serde feature: Serialize/Deserialize for WarpPlan and Chunk. (2026-10-28)
  • Parity fixtures for whole rasters warped in many chunks (tests/chunks.rs, tests/fixtures/chunks/): seven gdalwarp cases, chunk lists and output identical. (2026-10-28)
  • Cutlines (gdalwarp -cutline): WarpOptions::cutline / with_cutline, and the cutline module with Cutline (polygons in source pixel/line), CutlineRule::Centre (GDAL's default, with its tie rules), CutlineRule::AllTouched (CUTLINE_ALL_TOUCHED), blend distance (-cblend), and CutlineRule::Exact, which weights each source pixel by the fraction of it the cutline covers (not a GDAL mode). Cutline::from_geotransform and Cutline::from_transformer (densified as gdalwarp does) map world geometry to source pixels; Cutline::density is the per-pixel density the warp uses. The cutline is rasterized over the source buffer only, with controlledburn.

Removed

  • source_window::collect_chunk_list and ChunkPlan: use plan::plan_chunks (with ChunkOptions::split_antimeridian for the same split at the antimeridian). compute_source_window stays. (2026-10-28)

0.2.0 (2026-10-28)

This release changes the API: warp() with WarpOptions and SourceBuffer replaces the warp entry points of 0.1, and ResampleAlg gains variants.

Added

  • geoloc_transform: geolocation-array transformers, for a curvilinear source (gdalwarp -geoloc), a curvilinear target (DST_METHOD=GEOLOC_ARRAY), or both. Both of GDAL's georeferencing conventions; offsets and steps; nodata; antimeridian handling. (2026-10-28)

  • warp(), WarpOptions, SourceBuffer: one entry point for every sample type, method and option. WarpOptions carries a destination offset for warping one tile of a larger grid. (2026-10-28)

  • KernelScaling: GDAL's kernel widening when downsampling, now the default; Fixed and Point alternatives. estimate_scale is public. (2026-10-28)

  • ResampleAlg::Average, with Footprint::GdalBox (gdalwarp's) and Footprint::Exact (first-order conservative). controlledburn is a new dependency. (2026-10-28)

  • ResampleAlg::Mode with ModeTies (MODE_TIES). (2026-10-28)

  • BandNodata (UNIFIED_SRC_NODATA) and AverageThresholds (NODATA_VALUES_PCT_THRESHOLD, EXCLUDED_VALUES). (2026-10-28)

  • ResampleAlg::CubicSpline, Min, Max, Med, Q1, Q3 and Rms, and ResampleAlg::is_area(). (2026-10-28)

  • Sample for i64, u64, and half::f16 behind a new f16 feature. (2026-10-28)

  • warp_to::<S, D>: a different output type from the source's, through GDAL's working type (DataType::working) and GDALCopyWords conversion. (2026-10-28)

  • Nodata and DstNodata: source and destination nodata per band, as gdalwarp's -srcnodata and -dstnodata. (2026-10-28)

  • Examples: tile_laea, curvilinear_swath.

  • A documentation site, with the browser demo under /demo/.

Changed

  • Integer outputs round half up and clamp, and a resampled value equal to nodata is moved off it, as gdalwarp does with an integer working type.
  • Sample points outside [0, n) of the source are off the source for every point method, as in GDAL.
  • Lanczos clips its window and renormalises at edges and nodata, and a target pixel whose centre lands on nodata gets no value, for every interpolating kernel. Some edge and nodata pixels change compared with 0.1.
  • Multi-band nodata follows GDAL's default (a pixel is nodata only where every band is); the 0.1 rule is BandNodata::AnyBand.
  • Sample requires PartialOrd.
  • Footprint::Exact is 2 to 6x faster. The destination pixel lattice is transformed once per row band (shared corners and edge points) instead of four points per pixel, and coverage comes from controlledburn::CoverageWindow (0.2.2) instead of one burn call per pixel. With an exact transformer the output is unchanged, except for pixels straddling the antimeridian, which the exact footprint does not handle (it gave a different wrong answer before). The lattice's row lines go to the transformer as scanlines, so an ApproxTransformer now approximates them, as for the box footprint; before, it transformed the exact footprint's points exactly.
  • WarpOptions is not generic: nodata: Option<T> is replaced by src_nodata: Nodata and dst_nodata: DstNodata.
  • Bilinear uses GDAL's general formula for types and cases where GDAL does, which can change the last bit (and so integer rounding near 2^40 for 64-bit values).

Deprecated

  • warp_resample_t and warp_resample_u8, kept as shims with the 0.1 point-kernel behaviour. Use warp().

Fixed

  • Nearest neighbour mapped source coordinates in (-1, 0) to pixel 0.
  • ApproxTransformer left one point untransformed and reported it failed when subdivision reached a left half of two points, which happens on strongly curved transforms or with a small error threshold (whole columns of a polar warp came out as nodata). GDAL transforms it.

0.1.2 (2026-03-11, not on crates.io)

  • Use the system libproj through proj 0.31.

Not released to crates.io. On main after it (2026-09 to 2026-10):

  • rwarp-wasm: browser shim and demo (OSM, WMTS, ArcGIS tile services, COG sources), Warper.withTransforms for JavaScript CRS transforms.
  • A generic Sample kernel over u8 to f64, interleaved bands, nodata as a value or an alpha band.
  • The CrsTransform trait with proj and proj4rs backends; builds for wasm32-unknown-unknown.

0.1.1 (2026-03-06)

  • GcpTransformer: polynomial transformer from ground control points, order 1 to 3.
  • Use the published vaster crate; crate documentation.

0.1.0 (2026-03-06)

  • First release, extracted from cogcache: GenImgProjTransformer, ApproxTransformer, compute_source_window, collect_chunk_list and the nearest, bilinear, cubic and lanczos kernels.