[GRASS-user] nulls left by r.surf.nnbathy

Maciej Sieczka tutey at o2.pl
Wed Nov 15 12:00:25 EST 2006


Robert Nuske wrote:
>> When I change the resolution to nice round '2', by:
>>
>> $ g.region rast=nick.contours res=2 -ag
>>
>> the r.surf.nnbathy produces a good result - no speckles.
>>
>> I'll look into this. For know stick to round resolution, sorry.

> you mean whole numbers / integers?

As far as I can tell - multiples of 0.25. I've emailed the author
yesterday about the issue. I'll keep you updated via the grass-list.

> all my rasters have resolutions in the centimeter realm. does that mean no 
> nnbathy for me?

In my script I use nnbathy to generate the grid coordinates to
interpolate at, but it showed nnbathy fails to generate them properly
under some circumstances. However, you can tell nnbathy to interpolate
at coordinates which *you* specify in an ASCII file (read nnabthy -h
about the -i switch) eg.:

nnbathy -i input_xyz -o canvas_xyz > output_xyz

You can create such a "canvas" grid with r.stats -1g, which prints the
coordinates of cell's centers:

# spit out the "canvas" coords for nnbathy to interpolate in
r.stats -1g input=contours | awk '{print $1" "$2}' > canvas_xyz

Try using the attached earlier version of r.surf.nnbathy (1.2). It
implements this method. I was using it at first, but I switched to
letting nnbathy control the output grid coordinates, as this doesn't
require additional big temporary file. Unfortuantelly this method fails
when it comes to resolution different than a multiple of 0.25. I
couldn't find an error in my awk maths (which doesn't mean it's not
there for sure :) ) and emailed the nnbathy author. I'll let you know
once the problem is sorted out.

Best,
Maciek




More information about the grass-user mailing list