[GRASS-dev] v.surf.bspline

Hi devs,

I am running a v.surf.bspline (grass 7.8.3 on Windows) using the bilinear and de bicubic algorithm, like e.g. (NC dataset)

g.region raster=elev_lid792_1m
r.random input=elev_lid792_1m npoints=200 vector=samplepoints seed=20
v.surf.bspline input=samplepoints column=value raster_output=bspline_bilinear ew_step=50 ns_step=50
v.surf.bspline input=samplepoints column=value raster_output=bspline_bilinear ew_step=50 ns_step=50 method=bicubic

Results are exactly the same. Any idea if I am missing something here?

Best regards,

Paulo

Hi Paulo,

On Sun, Oct 4, 2020 at 3:46 PM Paulo van Breugel <p.vanbreugel@gmail.com> wrote:

Hi devs,

I am running a v.surf.bspline (grass 7.8.3 on Windows) using the bilinear and de bicubic algorithm, like e.g. (NC dataset)

g.region raster=elev_lid792_1m
r.random input=elev_lid792_1m npoints=200 vector=samplepoints seed=20
v.surf.bspline input=samplepoints column=value raster_output=bspline_bilinear ew_step=50 ns_step=50

--> raster_output=bspline_bilinear - ok

v.surf.bspline input=samplepoints column=value raster_output=bspline_bilinear ew_step=50 ns_step=50 method=bicubic

--> raster_output=bspline_bilinear - a copy-paste error in this email?

Results are exactly the same. Any idea if I am missing something here?

I tried myself:

g.region raster=elev_lid792_1m
r.random input=elev_lid792_1m npoints=200 vector=samplepoints seed=20

# verify the sample point values
v.univar samplepoints column=value
100%
number of features with non NULL attribute: 200
number of missing attributes: 0
number of NULL attributes: 0
minimum: 104.283
maximum: 131.352
range: 27.0692
sum: 24232.3
mean: 121.162
mean of absolute values: 121.162
population standard deviation: 6.16656
population variance: 38.0265
population coefficient of variation: 0.0508953
sample standard deviation: 6.18204
sample variance: 38.2176
kurtosis: -0.548097
skewness: -0.362208

# now interpolate and check what's being used
g.gisenv set="DEBUG=1"
v.surf.bspline input=samplepoints column=value
raster_output=bspline_bilinear1 ew_step=50 ns_step=50 method=bilinear
...
D1/1: Interpolation: (1,1): Bilinear interpolation...
...

v.surf.bspline input=samplepoints column=value
raster_output=bspline_bicubic1 ew_step=50 ns_step=50 method=bicubic
...
D1/1: Interpolation: (1,1): Bicubic interpolation...
...

g.gisenv set="DEBUG=0"
# calculate differences
r.mapcalc "diff = bspline_bilinear - bspline_bicubic"

# verify differences
r.univar diff -eg
n=525000
null_cells=0
cells=525000
min=-1.35428900518949
max=1.47700431246362
range=2.83129331765311
mean=0.0372330733156362
mean_of_abs=0.189272111683445
stddev=0.24882465890669
variance=0.0619137108800304
coeff_var=668.289337270996
sum=19547.363490709
first_quartile=-0.108568
median=0.0209677
third_quartile=0.181387
percentile_90=0.352807

Looks fine to me.

Markus

Hi Markus

Thanks for checking. I tried it yesterday on grass 7.8.4.1 (installed using osgeo4w) and got the same results as you did.

Reinstalled QGIS and GRASS GIS using the standalone installer (because of some unrelated problems). This installs grass 7.8.3. Tried out the same again, and the problem reappeared. What seems to be the problem is that the function always uses the bicubic interpolation method, see below.

g.gisenv set=“DEBUG=1”
v.surf.bspline input=samplepoints2 column=value raster_output=bilinear ew_step=50 ns_step=50


D1/1: Interpolation: (1,1): Bicubic interpolation…
100%

g.gisenv set=“DEBUG=1”
v.surf.bspline input=samplepoints2 column=value raster_output=bilinear2 ew_step=50 ns_step=50 method=bilinear


D1/1: Interpolation: (1,1): Bicubic interpolation…
100%

Cheers,

Paulo

On Sat, Oct 10, 2020 at 11:36 PM Markus Neteler <neteler@osgeo.org> wrote:

Hi Paulo,

On Sun, Oct 4, 2020 at 3:46 PM Paulo van Breugel <p.vanbreugel@gmail.com> wrote:

Hi devs,

I am running a v.surf.bspline (grass 7.8.3 on Windows) using the bilinear and de bicubic algorithm, like e.g. (NC dataset)

g.region raster=elev_lid792_1m
r.random input=elev_lid792_1m npoints=200 vector=samplepoints seed=20
v.surf.bspline input=samplepoints column=value raster_output=bspline_bilinear ew_step=50 ns_step=50

→ raster_output=bspline_bilinear - ok

v.surf.bspline input=samplepoints column=value raster_output=bspline_bilinear ew_step=50 ns_step=50 method=bicubic

→ raster_output=bspline_bilinear - a copy-paste error in this email?

Results are exactly the same. Any idea if I am missing something here?

I tried myself:

g.region raster=elev_lid792_1m
r.random input=elev_lid792_1m npoints=200 vector=samplepoints seed=20

verify the sample point values

v.univar samplepoints column=value
100%
number of features with non NULL attribute: 200
number of missing attributes: 0
number of NULL attributes: 0
minimum: 104.283
maximum: 131.352
range: 27.0692
sum: 24232.3
mean: 121.162
mean of absolute values: 121.162
population standard deviation: 6.16656
population variance: 38.0265
population coefficient of variation: 0.0508953
sample standard deviation: 6.18204
sample variance: 38.2176
kurtosis: -0.548097
skewness: -0.362208

now interpolate and check what’s being used

g.gisenv set=“DEBUG=1”
v.surf.bspline input=samplepoints column=value
raster_output=bspline_bilinear1 ew_step=50 ns_step=50 method=bilinear

D1/1: Interpolation: (1,1): Bilinear interpolation…

v.surf.bspline input=samplepoints column=value
raster_output=bspline_bicubic1 ew_step=50 ns_step=50 method=bicubic

D1/1: Interpolation: (1,1): Bicubic interpolation…

g.gisenv set=“DEBUG=0”

calculate differences

r.mapcalc “diff = bspline_bilinear - bspline_bicubic”

verify differences

r.univar diff -eg
n=525000
null_cells=0
cells=525000
min=-1.35428900518949
max=1.47700431246362
range=2.83129331765311
mean=0.0372330733156362
mean_of_abs=0.189272111683445
stddev=0.24882465890669
variance=0.0619137108800304
coeff_var=668.289337270996
sum=19547.363490709
first_quartile=-0.108568
median=0.0209677
third_quartile=0.181387
percentile_90=0.352807

Looks fine to me.

Markus

Hi Paulo,

On Sun, Oct 11, 2020 at 11:57 AM Paulo van Breugel
<p.vanbreugel@gmail.com> wrote:

Hi Markus

Thanks for checking. I tried it yesterday on grass 7.8.4.1 (installed using osgeo4w) and got the same results as you did.

Reinstalled QGIS and GRASS GIS using the standalone installer (because of some unrelated problems). This installs grass 7.8.3. Tried out the same again, and the problem reappeared.

I found the reason, it was fixed in
https://github.com/OSGeo/grass/pull/727

Amusingly I submitted the fix and you tested it :slight_smile:
It is also listed in the changes (which I realize only now):
https://trac.osgeo.org/grass/wiki/Release/7.8.4-News#Minormodulechanges
--> v.surf.bspline: fix method selection (PR:727)

Maybe it should be moved in to "major changes" section.

So, the bugfix has been published in the new GRASS GIS 7.8.4.
Hope you can install it.

cheers,
Markus