save_gdal.py: convert numpy array from boolean to uint8, as GDAL does not support boolean data type, such as used in all the mask files.
objects.cluster.split_box2sub_boxes(): avoid the tiny last step (<5% of the normal step, or <5 pixels), by merging it into the 2nd last one. This happens to very large datasets sometimes. For example, if the last step has a size of 1, a 3D matrix will be turned into 2D, resulting in a reshape error.
objects.cluster.split_box2sub_boxes(): return the final number of sub_boxes, in addition to the current list of sub_boxes, for easier usage (as it may be different from the initial num_box as identified in #940). Update the usage in all occurrences:
Description of proposed changes
save_gdal.py
: convert numpy array from boolean to uint8, as GDAL does not support boolean data type, such as used in all the mask files.objects.cluster.split_box2sub_boxes()
: avoid the tiny last step (<5% of the normal step, or <5 pixels), by merging it into the 2nd last one. This happens to very large datasets sometimes. For example, if the last step has a size of 1, a 3D matrix will be turned into 2D, resulting in a reshape error.objects.cluster.split_box2sub_boxes()
: return the final number of sub_boxes, in addition to the current list of sub_boxes, for easier usage (as it may be different from the initial num_box as identified in #940). Update the usage in all occurrences:Reminders