
Pick a raster pixel type LANDIS-II can read
landis_datatype.RdReturns the smallest terra datatype that LANDIS-II will open and that can
hold max_value. Use it for any integer-coded map written for LANDIS-II
(initial communities, ecoregions, fire regions), rather than choosing a
datatype by hand.
Value
A length-1 character datatype suitable for terra::writeRaster():
"INT1U", "INT2S" or "INT4S".
Details
LANDIS-II opens maps through
Landis.RasterIO.Gdal.GdalInputRaster.NewInputBand, which accepts only GDAL
Byte, Int16, Int32, Float32 and Float64, and aborts the run with
Raster band is not byte, short, int, float, double on anything else. The
unsigned integer types are therefore unusable even though map codes are
always positive – as is INT1S, which GDAL 3.7+ writes as Int8. Because
the check happens when the extension initialises rather than when the file is
written, an unreadable map is only discovered by running the model.