def test_value_at_pixel_returns_value_of_each_pixel_in_dataset(
        raster_dataset: RasterDataset):
    assert raster_dataset.value_at_pixel(band_index=0, row=0, column=0) == 1
    assert raster_dataset.value_at_pixel(band_index=0, row=0, column=1) == 2
    assert raster_dataset.value_at_pixel(band_index=0, row=1, column=0) == 3
    assert raster_dataset.value_at_pixel(band_index=0, row=1, column=1) == 4
    assert raster_dataset.value_at_pixel(band_index=1, row=0, column=0) == 11
    assert raster_dataset.value_at_pixel(band_index=1, row=0, column=1) == 12
    assert raster_dataset.value_at_pixel(band_index=1, row=1, column=0) == 13
    assert raster_dataset.value_at_pixel(band_index=1, row=1, column=1) == 14
Example #2
0
def test_read_pixel_returns_expected_pixel_values(
        raster_dataset: RasterDataset, array_assigned_to_band_index_1):
    assert raster_dataset.value_at_pixel(1, 0, 0) == array_assigned_to_band_index_1[0, 0]
    assert raster_dataset.value_at_pixel(1, 0, 1) == array_assigned_to_band_index_1[0, 1]
    assert raster_dataset.value_at_pixel(1, 1, 0) == array_assigned_to_band_index_1[1, 0]
    assert raster_dataset.value_at_pixel(1, 1, 1) == array_assigned_to_band_index_1[1, 1]