test.t.vect.univar.sh 1.5 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # Test the univar statistics of space time vector datasets
  3. # We need to set a specific region in the
  4. # @preprocess step of this test.
  5. # The region setting should work for UTM and LL test locations
  6. g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
  7. # Data generation
  8. v.random --o -z output=rpoints1 zmin=0 zmax=100 seed=1 column=height n=100
  9. v.random --o -z output=rpoints2 zmin=0 zmax=100 seed=2 column=height n=100
  10. v.voronoi --o input=rpoints1 output=rvoronoi1
  11. v.voronoi --o input=rpoints2 output=rvoronoi2
  12. t.create --o type=stvds temporaltype=absolute output=random_data title="A test" descr="A test"
  13. t.register type=vect --v -i input=random_data maps=rpoints1,rpoints2,rvoronoi1,rvoronoi2 start="2001-01-15 12:05:45" increment="14 days"
  14. # The first @test
  15. t.vect.univar -h input=random_data column=height where='height > 50' twhere="start_time > '2000-01-01'" layer=1
  16. t.vect.univar -he input=random_data column=height where='height > 30' twhere="start_time > '2000-01-01'" layer=1
  17. t.vect.univar -he type=area input=random_data column=height where='height > 10' twhere="start_time > '2000-01-01'" layer=1
  18. t.vect.univar -he type=centroid input=random_data column=height where='height > 20' twhere="start_time > '2000-01-01'" layer=1
  19. t.vect.univar -h type=line input=random_data column=height where='height > 20' twhere="start_time > '2000-01-01'" layer=1
  20. # @postprocess
  21. t.unregister type=vect maps=rpoints1,rpoints2,rvoronoi1,rvoronoi2
  22. t.remove type=stvds input=random_data
  23. g.remove vect=rpoints1,rpoints2,rvoronoi1,rvoronoi2