642def fetch_band_nodata(band, default = 0):
643 assert band is not None
644
645 nodata = default
646 if band.GetNoDataValue() is not None:
647 nodata = band.GetNoDataValue()
648 else:
649 logit("WARNING: No nodata flagged in raster_columns metadata. "
650 "In serialized raster, nodata bytes will have value of 0.\n")
651 return nodata
652