rwarp (development version)
Built on rwarp (the crate) 0.5.0, with controlledburn 0.3 and bigcurve 0.3. The R functions give the same results: the crate’s 0.4 and 0.5 changes are in its mesh and weights API, the exact footprint, and new functions on several threads, which the package doesn’t bind yet.
rwarp has a hex logo, drawn from rwarp’s own output: MUR sea surface temperature warped to Antarctic polar stereographic in a regular grid of tiles, and one row per tile for the plan. The site has favicons to match. The logo is made by the scripts in
design/logo/of the repository.The website (https://hypertidy.github.io/rwarp/r/) is fuller: a Get started article, grouped articles, the changelog, a light/dark switch, and source links that work. The
sentinel2-warpandghrsst-polararticles read from the network, so they are now website-only and precomputed (vignettes/articles/precompute.R) instead of installed vignettes that ran only withVWARP_VIGNETTES=true. Theghrsst-polarexample moved to 52 S, across the Antarctic Polar Front, at 10 km.New vignette,
vignette("rwarp"): plan and warpsst.tiffrom vapour onto polar stereographic, plot the plan’s chunks, and match gdalwarp (offline).plan-inspect’s antimeridian example now crosses the antimeridian, and shows the source windows the split reads against gdalwarp’s full-width strip.The examples of
warp_plan(),warp_exec()andpixel_transform()run (offline, nothing read from the network); the remote examples stay in\dontrun{}.warp_plan()can plan as gdalwarp plans (#67). New arguments describe the warp’s working memory as gdalwarp counts it:nbands,working_type,src_nodata,dst_nodata(whether there’s nodata; defaults tosrc_nodata) andmemory_limit(gdalwarp’s-wm, in MB). Newscale_origin = "output"estimates each chunk’s kernel scale as gdalwarp does. With these,min_fill_ratio = 0.5andmin_dst_size = 100L, the chunks are gdalwarp’s, and so are the values where the kernel widens: thesentinel2-warpvignette now matches gdalwarp at its default memory, without-wm. The defaults are unchanged.warp_exec()takesnbandsfrom the plan by default.warp_plan()andpixel_transform()accept sizes and offsets as whole-number doubles, asGDALRaster$getRasterXSize()returns them.The
sentinel2-warpvignette is rewritten (#55): two Sentinel-2 tiles from one overpass, in UTM zones 54 and 55, warped as three bands of float reflectance onto Australian Albers (EPSG:3577), combined in order as gdalwarp combines its inputs, and compared with gdalwarp’s mosaic of the same sources (the same nodata, values to 1e-11). It also reads one window once and warps it again withwarp_buffer().warp_exec()andwarp_buffer()document thatdst_nodata = NAwritesNaNfor double data, notNA;is.na()isTRUEfor both.New
warp_buffer()warps one pre-fetched source window with the crate’swarp()(#54). It has whatwarp_exec()has: every kernel, integer, double and raw data, several bands, source and destination nodata,band_nodata,mask_band,mode_ties, kernel scaling andoutput = "nara". The buffer is laid out asread_fnreturns it, or is a matrix or array in R orientation, and the result is a matrix or array, as fromwarp_exec(). On the windowwarp_plan()gives, it warps to the same pixels aswarp_exec().warp_resample()is deprecated in favour ofwarp_buffer(). It is integer-only,"near"or"bilinear", one band, and returns a row-major vector.warp_plan()documentsfill_ratio: GDAL’s, which can be above 1.warp_plan()gainssplit_antimeridian(defaultTRUE): a destination crossing the antimeridian of a global longitude/latitude source reads the two edges of the source instead of a full-width strip (about 11x fewer source pixels for a Pacific view of GEBCO), with the same values. A destination around a pole keeps gdalwarp’s plan.FALSEis gdalwarp’s plan everywhere. Needs rwarp (the crate) 0.3.3.warp_exec()runs its chunk loop in Rust and exposes the crate’s warp (rwarp 0.3.2): all of gdalwarp’s kernels (near,bilinear,cubic,cubicspline,lanczos,average,mode,min,max,med,rms), integer, double and raw (byte) data, multiple bands, source and destination nodata (one or per band),band_nodata(gdalwarp’sUNIFIED_SRC_NODATA),mask_bandandmode_ties. The data type follows whatread_fnreturns.warp_exec(output = "nara")returns anativeRasterfor 1-, 3- or 4-band raw data, packed in Rust, forplot(),grid::grid.raster()andpng::writePNG().warp_plan()gainsresampleandscaling("widen", gdalwarp’s default;"point", as-wo XSCALE=1 -wo YSCALE=1;"fixed", withscale), so source windows are padded for the kernel, and each chunk carries its kernel scale (scale_x,scale_y). The plan recordssrc_dim,dst_off,dst_size,resampleandscalingas attributes, whichwarp_exec()uses by default.warp_plan()now plans as gdalwarp does: it uses GDAL’s special points (so a pole inside the destination is found), builds the transformer with the source size and target extent (CENTER_LONG wrapping), andresample_paddingdefaults toNULL, gdalwarp’sSOURCE_EXTRArule, instead of1L.Against gdalwarp on the same GDAL build, on a lon/lat source downsampled to polar stereographic: every kernel matches exactly for Int16 and Byte data, and to 1e-9 for Float64, except
modeon floats, where GDAL’s tie-break differs from its own 8/16-bit path (rwarp keeps the 8/16-bit behaviour).warp_exec(nodata = )is deprecated: usesrc_nodataanddst_nodata.warp_resample()is unchanged.
