def test_raster_should_get_array_block(self): filename = 'data/RGB.byte.tif' raster = Raster(filename) array = raster.array_from_bands(block_win=(256, 256, 300, 300)) self.assertEqual(array.ndim, 3) self.assertEqual(array.shape, (300, 300, 3)) self.assertEqual(array.dtype, 'UInt8')
def test_raster_should_get_array_block_one_band(self): filename = 'data/RGB.byte.tif' raster = Raster(filename) array = raster.array_from_bands(2, block_win=(256, 256, 128, 128)) self.assertEqual(array.ndim, 2) self.assertEqual(array.shape, (128, 128)) self.assertEqual(array.dtype, 'UInt8')
def test_raster_should_get_array_one_band(self): filename = 'data/RGB.byte.tif' raster = Raster(filename) array = raster.array_from_bands(1) self.assertEqual(array.ndim, 2) self.assertEqual(array.shape, (718, 791)) self.assertEqual(array.dtype, 'UInt8')