Open LaurentBerder opened 1 year ago
Hi Laurent!
It's been a while since I originally started the library, and as a word of caution, I only needed it to read elevation data (single channel / layer) - it served that purpose but is sadly far from implementing the whole GeoTiff standard.
Looking at https://github.com/georust/geotiff/blob/master/src/lib.rs#L35, it should return the first layer, however, your panic seems to be happening already during parsing. Looking at https://github.com/georust/geotiff/blob/master/src/reader.rs#L303 it seems that one of the accessors (in img[curr_x][curr_y][curr_z]
) cause the error, and not necessarily the conversion of the value (self.vec_to_value::<Endian>(v);
). This could well be because your tiff has multiple layers.
Lots of coulds and woulds, I know (sorry!), but it was 5 years ago that I wrote the code... if you manage to dig into the library and fix the issues, happy to merge a PR! The library is not particularly large so it should be understandable fairly quickly :) (the GeoTiff spec on the other hand...)
Cheers
Thanks for your reply, @dominikbucher. As much as I'd love to give you a hand on this, I must be lucid on the fact that my level of mastery for Rust is not yet sufficient!
Hi,
I'm fairly new in Rust and wanted to try reading a
.tif
hyperspectral imaging file which contains multiple layers (its shape is(356, 724, 757)
, for 356 layers, width of 724 and height of 757 pixels).My first test was to just read the file, then look at value at coordinates (1, 1), which I'm guessing should be a vector of size 356.
But I run into this panic:
Should I understand that the multiplicity of layers is not handled by
geotiff
, or am I doing something wrong?