t.create.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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: Creates a space time dataset.
  18. #% keywords: temporal
  19. #% keywords: map management
  20. #% keywords: create
  21. #%end
  22. #%option G_OPT_STDS_OUTPUT
  23. #%end
  24. #%option G_OPT_STDS_TYPE
  25. #% description: The output type of the space time dataset
  26. #%end
  27. #%option G_OPT_T_TYPE
  28. #%end
  29. #%option
  30. #% key: semantictype
  31. #% type: string
  32. #% description: Semantic type of the space time dataset
  33. #% required: yes
  34. #% multiple: no
  35. #% options: min,max,sum,mean
  36. #% answer: mean
  37. #%end
  38. #%option
  39. #% key: title
  40. #% type: string
  41. #% description: Title of the new space time dataset
  42. #% required: yes
  43. #% multiple: no
  44. #%end
  45. #%option
  46. #% key: description
  47. #% type: string
  48. #% description: Description of the new space time dataset
  49. #% required: yes
  50. #% multiple: no
  51. #%end
  52. import grass.temporal as tgis
  53. import grass.script as grass
  54. ############################################################################
  55. def main():
  56. # Get the options
  57. name = options["output"]
  58. type = options["type"]
  59. temporaltype = options["temporaltype"]
  60. title = options["title"]
  61. descr = options["description"]
  62. semantic = options["semantictype"]
  63. tgis.init()
  64. tgis.create_space_time_dataset(name, type, temporaltype, title, descr,
  65. semantic, None, grass.overwrite())
  66. if __name__ == "__main__":
  67. options, flags = grass.parser()
  68. main()