[GRASS-dev] [grass-code I][314] r.in.xyz: estimated region half unit off

Hamish hamish_nospam at yahoo.com
Sun Feb 25 17:36:04 EST 2007


> > Initial Comment:
> > The region estimated by r.in.xyz -s is half column and half row off.
> > In Spearfish:
> > 
> > $ g.region rast=elevation.dted -ag
> > n=4927700
> > s=4913700
> > w=590000
> > e=609000
> > nsres=100
> > ewres=100
> > rows=140
> > cols=190
> > cells=26600
> > 
> > $ r.out.xyz in=elevation.dted out=points.xyz
> > 
> > $ r.in.xyz -s in=points.xyz out=points_re.xyz
> > Range:     min         max
> > x: 590050.000000 608950.000000
> > y: 4913750.000000 4927650.000000
> > z:    1.000000  255.000000
> > 
> > While, according to g.region -g output above, it should be:
> > 
> > x: 590000.000000 609000.000000
> > y: 4913700.000000 4927700.000000
> > z:    1.000000  255.000000


This is not a bug, -s scan extent of points results are correct.

r.out.xyz outputs points at cell centers, which are half a cell inside
of the region boundary (outer edge of cells).

r.in.xyz -s just reports what is in the input points file, it doesn't
try and merge that with the current region settings.

taking the scan extents result and plugging it into g.region -a
(re)creates the original region settings:

g.region w=590050 e=608950 s=4913750 n=4927650 res=100 -a
g.region -p 
[...]
north:      4927700
south:      4913700
west:       590000
east:       609000
nsres:      100
[...]


This is the approach the example in the r.in.xyz help page takes
already.

Nothing more to do. Closing bug.


Hamish




More information about the grass-dev mailing list