Commit d8c9aa2c authored by Hoek, Steven's avatar Hoek, Steven
Browse files

Arranged that the NODATA value can be set

parent 20cf3b9b
......@@ -86,7 +86,7 @@ class RowTiffRaster(GridEnvelope2D, BaseTiffRaster):
self.datafile.SetField("RowsPerStrip", 1)
self.datafile.SetField("PlanarConfig", 1) # contiguous
self.datafile.SetField("Orientation", 1) # top left
self.datafile.SetField("PageNumber", 1, 1)
self.datafile.SetField("PageNumber", (0, 1))
self.datafile.SetField("FillOrder", 1) # MSB2LSB
self.datafile.SetField("Compression", compression)
super(RowTiffRaster, self).set_extra_tags()
......@@ -125,10 +125,15 @@ class RowTiffRaster(GridEnvelope2D, BaseTiffRaster):
self.__numpy_type = self.datafile.get_numpy_type(self.__bits_per_sample, self.__sample_format)
self.__itemsize = self.__bits_per_sample / 8
self.__layer_size = self.ncols * self.__samples_per_pixel * self.__itemsize
if self.datafile.GetField("GDAL_NODATA") != None:
if self.__datatype == const.INTEGER:
self.nodatavalue = int(self.datafile.GetField("GDAL_NODATA"))
else:
self.nodatavalue = float(self.datafile.GetField("GDAL_NODATA"))
else:
if self.__datatype == const.INTEGER:
self.nodatavalue = int(self.nodatavalue)
super(RowTiffRaster, self).get_extra_tags()
if self.datafile.GetField("Compression") == 1: # none
......
Supports Markdown
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