-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rasterize by a specified function and column #333
Comments
This is a great idea Maybe instead using Then for the function we should be more specific than R raster and call it So something like: rasterize(df; to=myraster, source=:mycolumnname, reduce=mean) What do you think? Getting this to be fast and light on memory is the problem, as we need to store the values from each layer for every cell for the reducing function. One option for doing these reductions quickly but limit memory use is to break the raster into chunks, see which polygons overlap the chunk and calculate the vectors for each chunk. Then the memory can be much smaller and also be reused. For Edit: you might also want a |
Thanks, This is very close to what I believe would be the most useful feature of the rasterizing function on the Rasters.jl package. The one feature I would also propose is that you also add the option to calculate the values of the raster cells on the touching polygons. This is because: (1) in rasterize from the raster package you can only obtain a rasterization of polygons if the polygon crosses the center of the grid cell. The exception is if we use the getCover option, which then can only be done to one layer. (2) fasterize only does sums and it doesn't have the function of touching polygons - it is, however, faster than rasterize but it is a one-purpose tool. (3) the rasterize from the terra package does rasters based on polygon touches and is able to use different functions to calculate the values for the grid cells. What it doesn't do is both. If this could be implemented in the Rasters.jl package it would be great. Thank you, |
Hi there,
I was wondering if the Raster.jl package is able to rasterize by a specified function and using a specific column.
Thanks
The text was updated successfully, but these errors were encountered: