![]() ![]() Mean.circular(circular(x, units="degrees", rotation="clock", zero=pi/2, modulo="2pi"))Īnd here's the aggregate code I'm using (where 'angle' is a 1km raster with NA values scattered throughout): library(raster)Īngle5k <- aggregate(angle, fact=5, fun=avg.ang, expand=T)īut this returns a raster layer with a value ONLY at aggregated locations where every cell of the 5x5 window contains a value. Another way to reduce the result set is to use aggregate after a join. Here's my circular average function: library(circular) R package stars was written to support raster and vector data cubes (Chapter 6). Rescaling categorical raster data by spatial aggregation is common in large area ecological. (a) raster aggregated to g 5 (b) aggregated g 5 from publication: Effect of. The input is a raster function JSON object or an. Download scientific diagram Aggregation and interpolation of raster (f). Sorry for no working example, but not sure how to generate a similar example raster layer within R. A custom raster function that will be used to compute the pixel values of the aggregated rasters. The function used should return a single value, and the number of layers in the output Raster equals the number of unique values in indices. The layers to be combined are indicated with the vector indices. I'm not super experienced with functions, so the problem may be in there. Description Apply a function on subsets of a RasterStack or RasterBrick. Hi I am using your rasteraggnonint.r script to aggregate a large raster and it is amazing, thank you However, my script is taking ages to run and I was. I've tried modifying the na.action options of both the function and the aggregate() command, with no luck. ![]() In other words, where the aggregate window hits a 5x5 cell area with only, say, 5 cells with data values (20 NA cells), I still want it to return an average value for those 2 cells. As of now, I can't figure how to get aggregate() (or my function, if that's the problem) to provide a result value unless the raster has a contiguous 5x5 cell area. I am trying to aggregate this raster (using aggregate() command in the package) at, say, 5km resolution (factor=5) with a user-defined function for averaging circular angles (included below). ![]() the cells with data are not contiguous and have NA values scattered throughout). There are three types of aggregate functions available in RasterFrames: tile aggregate, DataFrame aggregate, and element-wise local aggregate. I have a 1km resolution raster in R with widespread NA values throughout, but at irregular locations (i.e. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |