partitionRaster function