Added internal method for writing to raster (#14)