Number of bits per sample.
Number of bits per sample. Should either be a multiple of 8, or evenly divide 8 (i.e. 1, 2 or 4).
Here we do a bunch of calculations around strip size.
Here we do a bunch of calculations around strip size. We limit each strip to 65K in size. Given that constraint, we can determine how many strips we need, how large each strip is, how many rows per strip we'll write, etc.
ESRI compatibility changes the data we write out.
ESRI compatibility changes the data we write out. It results in some extra TIFF tags and many extra GeoTIFF tags.
Int nodata value to use when writing raster.
String nodata value to use in GeoTIFF metadata.
The number of TIFF tags to be written.
The number of TIFF tags to be written.
If we update the writer to support additional TIFF tags this number needs to be increased also. The writeTag calls in write are numbered to help make this process easier.
The number of GeoTags to be written.
The number of GeoTags to be written.
If we write extra GeoTIFF tags this number needs to be increased.
Render the raster data into strips, and return an array of file offsets for each strip.
Render the raster data into strips, and return an array of file offsets for each strip. The strips may (or may not) be compressed.
Type of samples, using numeric constants from the TIFF spec.
Encodes the raster to GeoTIFF, and writes the data to the output stream.
Encodes the raster to GeoTIFF, and writes the data to the output stream.
This method does not return a result; the result is written into the output stream provided to Encoder's constructor. Many of the methods used by write mutate the object, and Encoder is not thread-safe, so it's important not to call this more than once.
Immediately write a byte array to the output stream.
(encoder: StringAdd).self
(encoder: StringFormat).self
(encoder: ArrowAssoc[Encoder]).x
(Since version 2.10.0) Use leftOfArrow
instead
(encoder: Ensuring[Encoder]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
Class for writing GeoTIFF data to a given DataOutputStream.
This class implements the basic TIFF spec [1] and also supports the GeoTIFF extension tags. It is not a general purpose TIFF encoder (it doesn't support renderings involving colors, multiband images, etc) but works well for encoding raster data.
It uses a single sample per pixel and encodes the data in one band. This means that files using more than 8-bit samples will often not render correctly in image programs like the Gimp. It also does not implement compression yet.
Future work may add compression options, as well as options related to the color palette, multiple bands, etc.
Encoders are not thread-safe and can only be used to write a single raster to single output stream. This is a consequence of how reliant the TIFF format is on embedding data addresses.
[1] http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf