[GRASS-user] Re: r.surf.nnbathy interpolation to whole region
Carlos "Guâno" Grohmann
carlos.grohmann at gmail.com
Thu Sep 6 17:20:23 EDT 2007
OK. thanks for the expalnation.
carlos
On 9/6/07, Maciej Sieczka <tutey at o2.pl> wrote:
> >> Maciek wrote
> > Carlos "Guâno" Grohmann wrote:
>
> >> Since nnbathy is cell-center oriented each
> >> N,S,E,W extent has to be shifted half a current GRASS region resolution
> >> to avoid it's output missalignment with current GRASS region.
>
> > I always though that GRASS was cell-center oriented..
>
> What do you mean?
>
> Explanation of why the shift in r.surf.nnbathy in necessary:
>
> The region:
>
> $ g.region -g
> n=404456
> s=404453
> w=315942
> e=315945
> nsres=1
> ewres=1
> rows=3
> cols=3
> cells=9
>
> The input raster (* stands for null):
>
> 315942.5 404455.5 20
> 315943.5 404455.5 74
> 315944.5 404455.5 43
> 315942.5 404454.5 29
> 315943.5 404454.5 *
> 315944.5 404454.5 65
> 315942.5 404453.5 25
> 315943.5 404453.5 25
> 315944.5 404453.5 49
>
> If the half-a-resolution shift IS applied (nnbathy -W 0 -P alg=nn -n
> 3x3 -x 315942.5 315944.5 -y 404455.5 404453.5), as described in
> previous post, the output of r.surf.nnbathy in=xxx out=yyy is alligned
> to the input raster:
>
> 315942.5 404455.5 20
> 315943.5 404455.5 74
> 315944.5 404455.5 43
> 315942.5 404454.5 29
> 315943.5 404454.5 48.25
> 315944.5 404454.5 65
> 315942.5 404453.5 25
> 315943.5 404453.5 25
> 315944.5 404453.5 49
>
> If the shift IS NOT applied (nnbathy -W 0 -P alg=nn -n 3x3 -x 315942
> 315945 -y 404456 404453), the output is missaligned and interpolated
> wrong, due to nnbathy working region set wrong:
>
> 315942 404456 NaN
> 315943.5 404456 NaN
> 315945 404456 NaN
> 315942 404454.5 NaN
> 315943.5 404454.5 48.25
> 315945 404454.5 NaN
> 315942 404453 NaN
> 315943.5 404453 NaN
> 315945 404453 NaN
>
> Maciek
>
--
+-----------------------------------------------------------+
Carlos Henrique Grohmann - Guano
Visiting Researcher at Kingston University London - UK
Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke
Can't stop the signal.
More information about the grass-user
mailing list