extent_vrt() now parses VRT XML with the xml2 package (a new suggested
dependency) instead of ad hoc string splitting (#16). Output is unchanged.
New "vaster and related tools" vignette, lining vaster up against GDAL/terra,
odc.geo GeoBox, rasterio point rasterization, and ImageMagick crop
geometry (#18, #10).
vaster_listxyz() gains a corner argument to return cell-corner (boundary)
coordinates (length ncol + 1 / nrow + 1) rather than cell centres (#9).
New x_center() and y_center(), US-spelling aliases for x_centre() and
y_centre() (#8).
New magick_geometry() to format a grid crop as an ImageMagick geometry
string ("WIDTHxHEIGHT+XOFF+YOFF") for use with magick::image_crop(). It is
the pixel-space sibling of rasterio0(), built on vcrop() and
grid_offset() (#5).
New lattice-alignment functions, folded in from the mdsumner/align sketch:
is_aligned(), grid_offset(), snap_grid(), resize_grid() and
grid_tiles(). Two grids are aligned when their resolutions are commensurate
and their origins differ by a whole number of the finer cells; the functions
refuse to proceed otherwise, so index arithmetic between aligned grids is exact.
One tolerance policy (sqrt(.Machine$double.eps), relative) is used throughout.
The align design doc is at inst/design-docs/align-design.md, and these
functions are documented in the new "Lattice Alignment & Tiling" vignette.
Fixed: extent_vrt() took ymin from the first (top) row and ymax from the last row, so
ymin > ymax for every tile, and used cell centres as edges, so each tile was
half a cell short on every side. The bundled NASADEM example hid the second
problem (3601 px tiles with a one-pixel overlap put the end centres on whole
degrees) and plot_extent()/rect() is indifferent to corner order. Now uses the
end-cell centres pushed out by half a cell, with y taken the right way round.
New function adjacency() for cell-based neighbourhood lookup, replacing the
old matrix shift functions (tl(), bl(), tr(), br(), la(), ta(),
ra(), ba()). The new function takes dimension and cell arguments
consistent with the rest of vaster, returning a matrix of neighbour cell
indices with named columns for direction. Supports "queen", "rook", and
"bishop" neighbourhood types.
Renamed ts() and te() to gdal_ts() and gdal_te() to avoid masking
stats::ts().
We now have internal functions col_from_x_c() and row_from_y_c(), x_from_col_c() and y_from_row_c() that use C under the hood, these currently accept and return 0-based indexes.
Package now requires compilation, with the R C api.
Speed up x_from_col and y_from_row, fixes #19.
New functions rasterio_idx() (was affinity::raster_to_rasterio), rasterio0 (was affinity::raster_io0) and
internal for now rasterio_crop().
differences are
New functions tl(), ta(), tr(), ra(), br(), ba(). br(), la()
which are top left, top, top right, right, bottom right, bottom, bottom right,
left. These are different from the affinity ones because they don't keep the
extra rows and columns (the variants in affinity might become options with
these). The 'a' means adjacent, we can't use t(), r(), l(), b() and top, right,
left, bottom seems weird.
New function from_xyz() to return a grid (dimension and extent) derived from
"XYZ" points, basically are the points (in whatever order, and may be
incomplete) on a regular grid within the rounding threshold of the 'digits'
parameter.
New functions ts(), te(), and ts_te() to format dimension,extent for use
with GDAL options.
plot_extent() is now vectorized, just give it xmin, xmax, ymin, ymax in that
order in vector, matrix, or data frame.
New function snap_extent() to replace spex::buffer_extent(), aliased to
buffer_extent() in this package.
Better argument consistency, dimension first, then extent.
New function extent_vrt() to obtain tile extents from VRT text.
New function vaster_listxyz() to convert extent, dimension, and optionally
data to trad image() format.
New function vaster_long() to convert extent, dimension, and optionally data
to long form XYZ in raster or trad matrix order.
All obvious raster functions now included (needs more testing).
Version bump to allow {grout} to depend on vaster for cell and extent ops.
Added a NEWS.md file to track changes to the package.