def write_raster(raster_name, arr, can_ovr): """ write a grass raster raster_name: the GRASS raster name arr: the array to be written in GRASS raster """ if can_ovr == True and raster.RasterRow(raster_name).exist() == True: utils.remove(raster_name, 'raster') #~ msgr.verbose(_("Removing raster map %s") % raster_name) with raster.RasterRow(raster_name, mode='w', mtype='DCELL') as newraster: newrow = raster.Buffer((arr.shape[1],), mtype='DCELL') for row in arr: newrow[:] = row[:] newraster.put_row(newrow)
def remove(self): """Remove the map""" if self.is_open(): self.close() utils.remove(self.name, "rast")
def remove(self): """Remove vector map""" if self.is_open(): self.close() utils.remove(self.name, 'vect')
def remove(self): """Remove the map""" if self.is_open(): self.close() utils.remove(self.name, 'rast')