test.v.random.sh 1.3 KB

123456789101112131415161718192021222324
  1. # This is a simple test for v.random
  2. # We create several identical pseudo random points maps :)
  3. # using the seed option for rand and drand48
  4. # In the @preprocess step we set up a suitable region
  5. g.region n=80 s=0 w=0 e=120 res=10 -p
  6. # First @test the rand function. Create a 3d vector map with attribute table
  7. # The validation is based on @vector map with a @precision=3
  8. v.random --o -z output=test_random_vect_1 n=20 zmin=0 zmax=100 seed=501
  9. # Now the attribute @table should be validated. Booth maps are identical
  10. v.random --o -z output=test_random_vect_2 n=20 zmin=0 zmax=100 column=height seed=501
  11. # Second @test the drand48 function. Create a 3d vector map with attribute table
  12. # The validation is based on @vector map with a @precision=3
  13. v.random --o -zd output=test_random_vect_3 n=20 zmin=0 zmax=100 seed=501
  14. # Now the attribute @table should be validated. Booth maps are identical
  15. v.random --o -zd output=test_random_vect_4 n=20 zmin=0 zmax=100 column=height seed=501
  16. # Export the generated data as references
  17. # v.out.ascii --o format=point dp=3 input=test_random_vect_1 output=test_random_vect_1.ref
  18. # db.select "select * from test_random_vect_2" > test_random_vect_2.ref
  19. # v.out.ascii --o format=point dp=3 input=test_random_vect_3 output=test_random_vect_3.ref
  20. # db.select "select * from test_random_vect_4" > test_random_vect_4.ref