test.r3.timestamp.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # This is a simple timestamp check, creation and removal test
  2. # We need to set a specific region in the
  3. # @preprocess step of this test. We generate
  4. # voxel data with r3.mapcalc.
  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. # Lets gerenate a test map
  8. r3.mapcalc --o expr="map3d = 1"
  9. # The first @test uses several different absolute datum formats
  10. r3.timestamp map=map3d date=none
  11. r3.timestamp map=map3d
  12. r3.timestamp map=map3d date="2003"
  13. r3.timestamp map=map3d
  14. r3.timestamp map=map3d date="Jul 2003"
  15. r3.timestamp map=map3d
  16. r3.timestamp map=map3d date="14 Jul 2003"
  17. r3.timestamp map=map3d
  18. r3.timestamp map=map3d date="14 Jul 2003 10"
  19. r3.timestamp map=map3d
  20. r3.timestamp map=map3d date="14 Jul 2003 10:30 +0700"
  21. r3.timestamp map=map3d
  22. r3.timestamp map=map3d date="14 Jul 2003 10:30:25"
  23. r3.timestamp map=map3d
  24. r3.timestamp map=map3d date="14 Jul 2003 10:30:25 +0700 / 15 Jul 2003 11:35:12 +0700"
  25. r3.timestamp map=map3d
  26. r3.timestamp map=map3d date="14 Jul 2003 10:30:25 +0700 / 15 Jul 2003"
  27. r3.timestamp map=map3d
  28. r3.timestamp map=map3d date=none
  29. r3.timestamp map=map3d
  30. # The second @test uses several different relative datum formats
  31. r3.timestamp map=map3d date=none
  32. r3.timestamp map=map3d
  33. r3.timestamp map=map3d date="2 years"
  34. r3.timestamp map=map3d
  35. r3.timestamp map=map3d date="2 years 3 months"
  36. r3.timestamp map=map3d
  37. r3.timestamp map=map3d date="5 days"
  38. r3.timestamp map=map3d
  39. r3.timestamp map=map3d date="3 hours"
  40. r3.timestamp map=map3d
  41. r3.timestamp map=map3d date="5 minutes 30 seconds"
  42. r3.timestamp map=map3d
  43. r3.timestamp map=map3d date="2 years 2 months / 5 years 8 months"
  44. r3.timestamp map=map3d
  45. r3.timestamp map=map3d date=none
  46. # The third @test to check @failure with wrong time stamps
  47. g.message message="Now checking for expected failures due to wrong time stamps..."
  48. r3.timestamp map=map3d date="2 years 3 months 8 days"
  49. r3.timestamp map=map3d date="1 month 5 days"
  50. r3.timestamp map=map3d date="July 2003"
  51. r3.timestamp map=map3d date="14 Jul 2003 +0700"