[GRASS-user] interpolation with data periodicity

Glynn Clements glynn at gclements.plus.com
Mon May 14 18:50:40 EDT 2007

Schmitt Thierry wrote:

> I wonder if there is any way of interpolating data concidering a 360
> periodicity (namely current orientation).

Not easily.

The simplest method which I can think of is angle->sin/cos,
interpolate both the sin/cos values, then sin/cos->angle (using
atan2). That can be done with a combination of r.mapcalc and the
interpolation command.

> If there is no solution in
> GRASS, I would be interested in earing your suggestions (I might be
> able to code it).

One option would be a module which adds a multiple of 360 to each cell
value so that the absolute difference from the preceding cell is
always less than 180.

Such data will then interpolate correctly (this is how e.g. d.vect
deals with polygons in lat/lon locations which cross the 180th

The result can be re-normalised to the +/- 180 (or 0-360) range with

A separate module is likely to be less work than adding this option to
all of the modules which interpolate values.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list