Return the nodata value for this band, or None if it isn't set.
(self)
| 143 | |
| 144 | @property |
| 145 | def nodata_value(self): |
| 146 | """ |
| 147 | Return the nodata value for this band, or None if it isn't set. |
| 148 | """ |
| 149 | # Get value and nodata exists flag |
| 150 | nodata_exists = c_int() |
| 151 | value = capi.get_band_nodata_value(self._ptr, nodata_exists) |
| 152 | if not nodata_exists: |
| 153 | value = None |
| 154 | # If the pixeltype is an integer, convert to int |
| 155 | elif self.datatype() in GDAL_INTEGER_TYPES: |
| 156 | value = int(value) |
| 157 | return value |
| 158 | |
| 159 | @nodata_value.setter |
| 160 | def nodata_value(self, value): |