File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
python/rsgislib/imagecalc Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1384,7 +1384,7 @@ def recode_int_raster(
13841384 recode_dict : Dict [int , int ],
13851385 keep_vals_not_in_dict : bool = True ,
13861386 gdalformat : str = "KEA" ,
1387- datatype : bool = rsgislib .TYPE_32INT ,
1387+ datatype : int = rsgislib .TYPE_32INT ,
13881388):
13891389 """
13901390 A function recodes an input image. Assuming image only has a single image band so
@@ -1428,7 +1428,7 @@ def recode_int_raster(
14281428 def _recode (info , inputs , outputs , otherargs ):
14291429 out_arr = numpy .zeros_like (inputs .inimage [0 ], dtype = otherargs .np_dtype )
14301430 if otherargs .keep_vals_not_in_dict :
1431- out_arr = inputs .inimage [0 ]
1431+ numpy . copyto ( out_arr , inputs .inimage [0 ], casting = 'same_kind' )
14321432
14331433 for rc_val in recode_dict :
14341434 out_arr [inputs .inimage [0 ] == rc_val ] = recode_dict [rc_val ]
You can’t perform that action at this time.
0 commit comments