Hello all. I would like to use bilinear interpolation or cubic
convolution interpolation to do some cross validation when
interpolating site data to raster format. My site data are scattered
and their locations will not necessarily line up with cell centers.
I'm trying to do a little better than just picking the nearest cell to
estimate an error.
My question is: is this capability already available in GRASS?
Just thought I'd check before I spend too much time on this. I can
envision a shell-script solution, but I'll probably create another
GRASS command (in C) unless someone stops me.
This operation is sort of like r.resample (it uses nearest cell and is
lacking the other two methods), except I only want a few estimates at
precise, non-gridded locations.
--Darrell
P.S. if this isn't already implemented, what should the
new command be called? s.sample? The I/O would be
s.sample [-qclBC] input=name rast=name [z=value] [output=name]
where input/output are sites. Output is difference
between interpolated value from cells and input-site.
z is a scaling factor to multiply cell values by (e.g.,
0.001 if cell values are 1000 time the actual z value)
-q quiet; -c use category label instead of category;
-l use description if sites format is "N|E|#n desc";
-B use bilinear method; -C use cubic convolution method
(default method is nearest neighbor)
Darrell,
Hello all. I would like to use bilinear interpolation or cubic
convolution interpolation to do some cross validation when
interpolating site data to raster format. My site data are scattered
and their locations will not necessarily line up with cell centers.
I'm trying to do a little better than just picking the nearest cell to
estimate an error.
My question is: is this capability already available in GRASS?
I am not sure if I understand you, but if you are going from site
to cell and you use something like idw or krig the absolute distance
from the site position to the cell center is used in the
interpolation. The actual point ceases to exist at the end of the
day so whether it lines up with a cell centre or not is irrelavent.
If you want exact interpolation (ie you want that specific
point value to exist in the cell layer) they you just weight it
appropriately.
Can you explain why scattered data is a problem, I think I am
missing something...
chris
Chris W Skelly (gewcs@jcu.edu.au) writes on 4 Jan 94:
Hello all. I would like to use bilinear interpolation or cubic
convolution interpolation to do some cross validation when
interpolating site data to raster format. My site data are scattered
I am not sure if I understand you, but if you are going from site
to cell and you use something like idw or krig the absolute distance
from the site position to the cell center is used in the
The interpolation knows nothing about the site in question.
See below.
interpolation. The actual point ceases to exist at the end of the
day so whether it lines up with a cell centre or not is irrelavent.
If you want exact interpolation (ie you want that specific
point value to exist in the cell layer) they you just weight it
appropriately.
Can you explain why scattered data is a problem, I think I am
missing something...
When doing cross validation, I REMOVE some of the original data before
doing the interpolation [using s.kcv]. Point c is of the set of
removed points.
Then, I interpolate to a particular resolution. That gives me my
estimate (Point %). Here are two cells of my raster map with
the site overlayed.
____|_____________|_____________|___
| | |
| | |
| | |
| c % | % |
| | |
| | |
____|_____________|_____________|___
| | |
To get an error estimate:
1. nearest cell says subtract 'c' from the value of the left cell.
2. bilinear interpolation uses four neighboring cell values (2x2)
to do 3 linear interpolations and get an approximate value at 'c'
3. cubic convolution uses 16 (4x4) surrounding cells, does some
convolutions, etc.
With an infinite amount of disk space and time, I could
interpolate to an infinitely small cell size and use method #1.
[The real problem is that I'm using some canned interpolation
software for which I do not have source code. Therefore, I cannot
get estimates at precise points
]
I hope this clears things up.
--Darrell
Darrell McCauley (mccauley@ecn.purdue.edu) writes on 3 Jan 94:
Hello all. I would like to use bilinear interpolation or cubic
convolution interpolation to do some cross validation when
interpolating site data to raster format. My site data are scattered
My question is: is this capability already available in GRASS?
s.sample, which samples raster maps at site locations using either
nearest neighbor sampling, bilinear interpolation, or cubic
convolution interpolation, is available by anonymous ftp from:
pasture.ecn.purdue.edu:pub/mccauley/grass/s.sample.tar.gz
Output is a sites list with values of the raster map. Optionally, the
program will take the difference between values in the input-site-file
and the raster map.
Included are a man page, a tutorial on the methods, and some sample
data with a g.gnuplot input file to convince you that it works.
This has not been tested extensively. I welcome feedback.
--Darrell
James Darrell McCauley, Purdue Univ, West Lafayette, IN 47907-1146, USA
mccauley@ecn.purdue.edu, mccauley%ecn@purccvm.bitnet, pur-ee!mccauley
** will finish PhD/engr in 9/94 - need job. inquiries welcome (no hh, plz) **
P.S. should r.resample employ some of these techniques?