d.shadedmap.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #%end
  20. #%option G_OPT_R_INPUT
  21. #% key: reliefmap
  22. #% description: Name of shaded relief or aspect raster map
  23. #%end
  24. #%option G_OPT_R_INPUT
  25. #% key: drapemap
  26. #% description: Name of raster to drape over relief raster map
  27. #%end
  28. #%option
  29. #% key: brighten
  30. #% type: integer
  31. #% description: Percent to brighten
  32. #% options: -99-99
  33. #% answer: 0
  34. #%end
  35. import sys
  36. from grass.script import core as grass
  37. def main():
  38. drape_map = options['drapemap']
  39. relief_map = options['reliefmap']
  40. brighten = options['brighten']
  41. ret = grass.run_command("d.his", h_map = drape_map, i_map = relief_map, brighten = brighten)
  42. sys.exit(ret)
  43. if __name__ == "__main__":
  44. options, flags = grass.parser()
  45. main()