[GRASS-user] r.resamp.bspline vs. v.surf.bspline

Markus Neteler neteler at osgeo.org
Tue Jun 25 14:11:36 PDT 2024


Hi Victor,

On Tue, Jun 18, 2024 at 7:07 AM Victor Lundström via grass-user
<grass-user at lists.osgeo.org> wrote:
>
> Hi everyone,
>
> I'm trying to interpolate a, for my machine, fairly large raster of 340,779,478 cells with 246x246 meter resolution.
> The way I've gone about it before has been to first use r.random, sample 100% of the cells and then use v.surf.bspline for
> interpolation. This always works on smaller data sets, but with this large one, I repeatedly only get a point layer that
> doesn't include the column with the values that should be interpolated.

This part I don't fully get yet: which column do you expect? In the
end, you can only use what's generated by r.random (unless you do
further steps not described above).

> Not sure if I'm missing a step or two in r.random, or
> if it's a size thing. Since my attempts repeatedly fail, I started looking at using r.resamp.bspline instead, as it only requires for
> me to load the input raster and, just like v.surf.bspline, r.resamp.bspline is said to also perform "bicubic or bilinear spline interpolation
> with Tykhonov regularization".
>
> Should I expect a different result from using just r.resamp.bspline as opposed to my r.random -> v.surf.bspline? Seeing as it is found
> under the "resamp" modules?
>
> I hope I can get some clarification on this!

Looking at the methods:

A) r.random + v.surf.bspline:
- r.random: This tool samples the raster cells at random. If you
sample 100% of the cells, you are essentially converting the raster to
points. Wouldn't r.to.vect do that as well?
- v.surf.bspline: This tool interpolates a raster surface from the
point data using B-spline interpolation.

Pros:
- Allows for selective sampling if needed.
- Can be used when you need to perform additional processing on the
point data before interpolation.

Cons:
- More complex workflow.
- May lead to issues with very large datasets, as you've experienced.

B) r.resamp.bspline:
- This tool directly performs bicubic or bilinear spline interpolation
on the raster without needing to convert it to points.

Pros:
- Simpler and more direct workflow.
- Designed for resampling and interpolating large rasters.

Cons:
- Less flexibility in terms of intermediate data manipulation.

Some recommendations:
Given that you are dealing with a very large raster and have
encountered issues with the r.random and v.surf.bspline approach,
using r.resamp.bspline might be more efficient and reliable. This tool
is designed specifically for resampling and should handle large
datasets better.

Expected Results
- Performance: r.resamp.bspline should handle large raster maps more
efficiently.
- Accuracy: Both methods use spline interpolation, so the results
should be similar in terms of interpolation quality.
- Simplicity: r.resamp.bspline offers a more straightforward process
without the intermediate steps.

Switching to r.resamp.bspline might be a practical approach here.

HTH,
Markus


More information about the grass-user mailing list