Commit 5e2a2eac authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed nodata value warning during L2B.

parent c78dff7a
......@@ -1513,7 +1513,8 @@ class RSImage_Predictor(object):
# apply prediction
# NOTE: prediction is applied in 1000 x 1000 tiles to save memory (because classifier.predict returns float32)
image_predicted = GeoArray(np.empty((image.rows, image.cols, classifier.tgt_n_bands), dtype=image.dtype))
image_predicted = GeoArray(np.empty((image.rows, image.cols, classifier.tgt_n_bands), dtype=image.dtype),
geotransform=image.gt, projection=image.prj, nodata=image.nodata)
for ((rS, rE), (cS, cE)), im_tile in image.tiles(tilesize=(1000, 1000)):
# 3D -> 2D
......@@ -1531,6 +1532,9 @@ class RSImage_Predictor(object):
if image.nodata is not None:
image_predicted[image.mask_nodata[:] == 0] = image.nodata
# copy mask_nodata
image_predicted.mask_nodata = image.mask_nodata
return image_predicted
@staticmethod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment