@@ -220,7 +220,7 @@ def test_create_browse_imagery_with_mocks(
220
220
src_crs = da_mock .rio .crs ,
221
221
dst_transform = target_transform ,
222
222
dst_crs = CRS .from_string ('EPSG:4326' ),
223
- dst_nodata = 255 , # NODATA_IDX
223
+ dst_nodata = 255 , # NODATA_IDX
224
224
resampling = Resampling .nearest ,
225
225
),
226
226
]
@@ -305,19 +305,18 @@ def test_convert_singleband_to_raster_with_colormap(self):
305
305
dtype = 'uint8' ,
306
306
)
307
307
expected_palette = {
308
- 0 : (255 , 0 , 0 , 255 ), # red
309
- 1 : (255 , 255 , 0 , 255 ), # yellow
310
- 2 : (0 , 255 , 0 , 255 ), # green
311
- 3 : (0 , 0 , 255 , 255 ), # blue
312
- 4 : (0 , 0 , 0 , 0 ), # alpha
308
+ 0 : (255 , 0 , 0 , 255 ), # red
309
+ 1 : (255 , 255 , 0 , 255 ), # yellow
310
+ 2 : (0 , 255 , 0 , 255 ), # green
311
+ 3 : (0 , 0 , 255 , 255 ), # blue
312
+ 4 : (0 , 0 , 0 , 0 ), # alpha
313
313
}
314
314
# Read down: red, yellow, green, blue
315
315
image_palette = convert_colormap_to_palette (self .colormap )
316
316
actual_raster , actual_palette = convert_singleband_to_raster (ds , image_palette )
317
317
assert_array_equal (expected_raster , actual_raster , strict = True )
318
318
assert_equal (expected_palette , actual_palette )
319
319
320
-
321
320
def test_convert_singleband_to_raster_with_colormap_and_bad_data (self ):
322
321
data_array = np .array (self .data , dtype = 'float' )
323
322
data_array [0 , 0 ] = np .nan
@@ -337,11 +336,11 @@ def test_convert_singleband_to_raster_with_colormap_and_bad_data(self):
337
336
dtype = 'uint8' ,
338
337
)
339
338
expected_palette = {
340
- 0 : (255 , 0 , 0 , 255 ), # red
341
- 1 : (255 , 255 , 0 , 255 ), # yellow
342
- 2 : (0 , 255 , 0 , 255 ), # green
343
- 3 : (0 , 0 , 255 , 255 ), # blue
344
- 4 : (10 , 20 , 30 , 40 ), # nv
339
+ 0 : (255 , 0 , 0 , 255 ), # red
340
+ 1 : (255 , 255 , 0 , 255 ), # yellow
341
+ 2 : (0 , 255 , 0 , 255 ), # green
342
+ 3 : (0 , 0 , 255 , 255 ), # blue
343
+ 4 : (10 , 20 , 30 , 40 ), # nv
345
344
}
346
345
347
346
colormap = {** self .colormap , 'nv' : nv_color }
0 commit comments