test.r3.neighbors.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. g.region w=0 e=30 s=0 n=30 b=0 t=30 res3=10
  3. r3.mapcalc --o expr="test_neighbor_float = float(3)"
  4. r3.mapcalc --o expr="test_neighbor_double = double(3)"
  5. r3.mapcalc --o expr="test_neighbor_null = null()"
  6. # First @test with float values with @precision=2
  7. r3.neighbors input=test_neighbor_float output=test_neighbor_float_average \
  8. method=average window=3,3,3 --o
  9. r3.out.ascii dp=2 input=test_neighbor_float_average output=test_neighbor_float_average.txt
  10. r3.neighbors input=test_neighbor_float output=test_neighbor_float_sum \
  11. method=sum window=3,3,3 --o
  12. r3.out.ascii dp=2 input=test_neighbor_float_sum output=test_neighbor_float_sum.txt
  13. # Second @test with double values
  14. r3.neighbors input=test_neighbor_double output=test_neighbor_double_average \
  15. method=average window=3,3,3 --o
  16. r3.out.ascii dp=2 input=test_neighbor_double_average output=test_neighbor_double_average.txt
  17. r3.neighbors input=test_neighbor_double output=test_neighbor_double_sum \
  18. method=sum window=3,3,3 --o
  19. r3.out.ascii dp=2 input=test_neighbor_double_sum output=test_neighbor_double_sum.txt
  20. # Third @test with null values
  21. r3.neighbors input=test_neighbor_null output=test_neighbor_null_sum \
  22. method=sum window=3,3,3 --o
  23. r3.out.ascii dp=2 input=test_neighbor_null_sum output=test_neighbor_null_sum.txt