Skip to content

Commit

Permalink
spliting set nodata and dataype into two functions in raster class
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Bierbower authored and Will Bierbower committed Apr 13, 2015
1 parent 2394773 commit 25b91ab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fauxgeo/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,18 @@ def set_band(self, masked_array):
def set_bands(self, array):
raise NotImplementedError

def change_datatype_and_nodata(self, datatype, nodata_val):
def set_datatype(self, datatype):
array = self.get_band(1)
affine = self.get_affine()
proj = self.get_projection()
nodata_val = self.get_nodata(1)
return Raster.from_array(array, affine, proj, datatype, nodata_val)

def set_nodata(self, nodata_val):
array = self.get_band(1)
affine = self.get_affine()
proj = self.get_projection()
datatype = self.get_datatype(1)
return Raster.from_array(array, affine, proj, datatype, nodata_val)

def copy(self, uri=None):
Expand Down

0 comments on commit 25b91ab

Please sign in to comment.