NEWS


guerrilla 0.4.0.9000

anglr and rgl leave Suggests

rgl needs OpenGL, and macOS 26 (Tahoe) no longer provides it, so rgl.so cannot be loaded at all: Library not loaded: /opt/X11/lib/libGLU.1.dylib. anglr loads rgl while byte-compiling, so anglr cannot be installed there either, and because both were in Suggests that broke the macOS CI job before R CMD check ever started.

Neither package was used by any code here. They appeared once, in a mesh_raster() example guarded by interactive(), which R CMD check never runs. So they are gone, and with anglr goes the Remotes: line and the last non-CRAN dependency.

The picture they drew is worth keeping, so it moved to vignette("triangulation") as code that is shown rather than run.

Package names were disappearing from the vignettes

\pkg{} is Rd markup. In an R Markdown vignette pandoc reads it as raw LaTeX and drops it, so "comes from \pkg{vaster}, which does grid index work" rendered as "comes from , which does grid index work". Ten of them across the four articles, now bold text instead. The roxygen blocks are unaffected, since those really do become Rd.

guerrilla 0.4.0

Four articles instead of one long one

irreg2.Rmd was the whole package's documentation, and it had grown to cover what a grid is, how barycentric coordinates work, eight interpolation methods, and what happens when you project the coordinates. Those are four things.

New _pkgdown.yml groups the reference index by what things are for, with the superseded functions in their own section rather than mixed in with the rest.

README

Rewritten around a worked example and two figures: the same points interpolated two ways, and then a prediction next to its standard error. It says what the package is for in the first two lines, which the old one did not.

Deprecations, finished

defaultgrid() and tri_fun() warn and forward to grid_spec() and grid_barycentric(). facets() is superseded without a warning, since it still does what it always did and its help page now explains what that was. All three are grouped as superseded on the reference index.

as_gdalraster() documents that it returns the open GDALRaster, not a file name, and that the caller closes it. It always did; the help page did not say so, and the new grids article found that out the hard way.

Coordinates of any magnitude, and a bug that had been waiting

geometry::tsearch() builds a quadtree over the input points, and on some coordinate ranges the insertion fails outright with "Failed to insert point into QuadTree". This package's own transect, projected to metres on a local equal-area, is one of those ranges. So was the same data scaled by 1000. Scaled by 10000 it is fine, so it is not a threshold anyone can steer around.

Barycentric weights do not change when a triangle and a point inside it are translated and scaled together, so grid_barycentric() (and mesh_raster(), which shares the path) now centres and scales the coordinates before triangulating and searching. The answer is unaffected and the failure cannot happen. Qhull is happier for the same reason.

This only shows up once you leave degrees, which is a reason to try work in a projection even when nothing requires it.

GDAL's own gridder

New article: coordinates, projections, and GDAL

Interpolating the transect in degrees and in a local equal-area gives surfaces that differ by up to a fifth of the range of the data, and cover different areas, because a straight line in one projection is not a straight line in another and the convex hull is made of straight lines. Neither is more correct and the interpolation cannot choose; the article is about making the question visible rather than settling it.

It also closes the loop on thin plate splines. grid_tps() fits a spline to (x, y) -> value; GDAL's -tps warping fits one to (pixel, line) -> (x, y). Fitting fields::Tps() to the same sixteen ground control points GDAL was given, and comparing against which input pixel each warped cell actually came from, gives a mean offset of 0.001 pixels over 8631 cells. Georeferencing an image and interpolating a temperature field are the same operation.

The methods are functions now, not closures in a vignette

Six of the methods the vignette demonstrated existed only as closures inside it, each one wrapping its engine in raster::interpolate() and a bit of coercion. They are exported functions with the same signature as everything else: coordinates, values, a grid.

No sp, and no raster in the middle of anything

gstat takes plain data frames with the coordinates given as a formula (locations = ~ x + y), and fields and mgcv predict at a matrix of coordinates. So none of these methods needs a spatial class: the statistical engines never wanted one, they wanted coordinates and a predict method. The conversion functions are still there for handing a result to another package, but nothing in this package's own path goes through them any more.

sp leaves Suggests, along with stars, dplyr and viridis, which nothing had used for some time.

Vignette

Rewritten again, onto the exported functions. The closures are gone, each section is now a call and an explanation of what the call assumed, and it ends with all eight surfaces on one page -- which mostly shows that they agree where there is data and disagree where there is not.

Removed about 130 lines of commented-out code at the end, which used sp, maptools and spatstat interfaces that no longer exist.

Interpolation has a name, and the weights are visible

tri_fun() said what it was implemented with. The methods are now named for what they compute, and the arithmetic each one rests on is written out in R next to the fast path, so the vignette can show it rather than assert it.

Input is coordinates, not a class

The grid is a list now

Everything that returned a RasterLayer returns a guerrilla_grid, which is a list of four things and nothing else: dimension (ncol, nrow), extent (xmin, xmax, ymin, ymax), crs, and values. str() on one is the complete explanation of what a raster is, which is the point.

The numbers did not change. tri_fun() and mesh_raster() produce values identical to 0.2.0 on volcano, on the zooplankton transect, and on quakes.

Repeated coordinates

A triangulation cannot hold two values at one place, and Qhull's answer was to drop points and warn about it. tri_fun() and mesh_raster() now combine them first, with duplicates = mean by default, and say how many they combined. duplicates = NULL restores the old behaviour exactly. New collapse_duplicates() does it on its own.

Coordinates that are all on one line make Qhull return zero triangles and only warn; that now raises an error that says what happened.

Vignette

Rewritten onto the new grid, converting to a raster only where a third-party function needs one -- which makes the boundary between this package and the statistical engines visible, rather than incidental.

Getting the package to build again

guerrilla 0.2.0

guerrilla 0.1.0