Skip to content

thread 'main' panicked at 'index out of bounds: the len is 724 but the index is 724 #6

Description

@LaurentBerder

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.

extern crate geotiff;

fn main() {
    let geotiff = geotiff::TIFF::open("path_to_my_file.tif").unwrap();
    println!("{:?}", geotiff);

    let pixel = geotiff.get_value_at(1, 1);
    println!("{:?}", pixel);
}

But I run into this panic:

thread 'main' panicked at 'index out of bounds: the len is 724 but the index is 724', ...index.crates.io-6f17d22bba15001f\geotiff-0.0.2\src\reader.rs:303:17

Should I understand that the multiplicity of layers is not handled by geotiff, or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions