test.r3.neighbors.sh 1.3 KB

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