t.create.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. ############################################################################
  4. #
  5. # MODULE: t.create
  6. # AUTHOR(S): Soeren Gebbert
  7. #
  8. # PURPOSE: Create a space-time dataset
  9. # COPYRIGHT: (C) 2011 by the GRASS Development Team
  10. #
  11. # This program is free software under the GNU General Public
  12. # License (version 2). Read the file COPYING that comes with GRASS
  13. # for details.
  14. #
  15. #############################################################################
  16. #%module
  17. #% description: Create a space-time dataset
  18. #% keywords: spacetime dataset
  19. #% keywords: create
  20. #%end
  21. #%option
  22. #% key: name
  23. #% type: string
  24. #% description: Name of the new space-time dataset
  25. #% required: yes
  26. #% multiple: no
  27. #%end
  28. #%option
  29. #% key: granularity
  30. #% type: string
  31. #% description: The granularity of the new space-time dataset (NNN day, NNN week, NNN month)
  32. #% required: yes
  33. #% multiple: no
  34. #%end
  35. #%option
  36. #% key: semantictype
  37. #% type: string
  38. #% description: The semantic type of the space-time dataset
  39. #% required: yes
  40. #% multiple: no
  41. #% options: event, const, continuous
  42. #% answer: event
  43. #%end
  44. #%option
  45. #% key: type
  46. #% type: string
  47. #% description: Type of the space time dataset, default is strds
  48. #% required: no
  49. #% options: strds
  50. #% answer: strds
  51. #%end
  52. #%option
  53. #% key: temporaltype
  54. #% type: string
  55. #% description: The temporal type of the space time dataset, default is absolute
  56. #% required: no
  57. #% options: absolute,relative
  58. #% answer: absolute
  59. #%end
  60. #%option
  61. #% key: title
  62. #% type: string
  63. #% description: Title of the new space-time dataset
  64. #% required: yes
  65. #% multiple: no
  66. #%end
  67. #%option
  68. #% key: description
  69. #% type: string
  70. #% description: Description of the new space-time dataset
  71. #% required: yes
  72. #% multiple: no
  73. #%end
  74. import sys
  75. import os
  76. import getpass
  77. import subprocess
  78. import grass.script as grass
  79. ############################################################################
  80. def main():
  81. # Get the options
  82. name = options["name"]
  83. type = options["type"]
  84. temporaltype = options["temporaltype"]
  85. title = options["title"]
  86. descr = options["description"]
  87. semantic = options["semantictype"]
  88. gran = options["granularity"]
  89. if __name__ == "__main__":
  90. options, flags = grass.core.parser()
  91. main()