d.shadedmap.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env python
  2. #
  3. ############################################################################
  4. #
  5. # MODULE: d.shadedmap
  6. # AUTHOR(S): Unknown; updated to GRASS 5.7 by Michael Barton
  7. # Converted to Python by Glynn Clements
  8. # PURPOSE: Uses d.his to drape a color raster over a shaded relief map
  9. # COPYRIGHT: (C) 2004,2008 by the GRASS Development Team
  10. #
  11. # This program is free software under the GNU General Public
  12. # License (>=v2). Read the file COPYING that comes with GRASS
  13. # for details.
  14. #
  15. #############################################################################
  16. #%module
  17. #% description: Drapes a color raster over a shaded relief map.
  18. #% keywords: display
  19. #% keywords: elevation
  20. #%end
  21. #%option G_OPT_R_INPUT
  22. #% key: reliefmap
  23. #% description: Name of shaded relief or aspect raster map
  24. #%end
  25. #%option G_OPT_R_INPUT
  26. #% key: drapemap
  27. #% description: Name of raster to drape over relief raster map
  28. #%end
  29. #%option
  30. #% key: brighten
  31. #% type: integer
  32. #% description: Percent to brighten
  33. #% options: -99-99
  34. #% answer: 0
  35. #%end
  36. import sys
  37. from grass.script import core as grass
  38. def main():
  39. drape_map = options['drapemap']
  40. relief_map = options['reliefmap']
  41. brighten = options['brighten']
  42. ret = grass.run_command("d.his", h_map = drape_map, i_map = relief_map, brighten = brighten)
  43. sys.exit(ret)
  44. if __name__ == "__main__":
  45. options, flags = grass.parser()
  46. main()