Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to use 'd.out.file' to save the displayed map to a PNG file. It failed and produced this message: "Command 'd.out.file' not yet implemented in the GUI. Try adding it as a command layer instead."

How can I resolve this? It also seems that I cannot run other d.* commands

share|improve this question

3 Answers 3

It seems you have to run it using the terminal (in command line)

share|improve this answer
    
I used the GRASS 6.4.0 with MSYS in order to type in the command-line window, but there was still an error because I cannot create a monitor –  teamAngat Feb 26 '11 at 18:14
1  
d.mon x0 see : ing.unitn.it/~grass/docs/tutorial/english/terminale_en.htm –  simo Feb 26 '11 at 18:26
1  
Without an X Server you cannot use the classical GRASS monitors on Windows. But GRASS 6.4+ offers you a new graphical user interface with the same possibility to output into PNG files. –  markusN Feb 27 '11 at 9:21
    
Yes, I could save the map into a PNG file using the "save" option in the wxPython based graphical user interface. Is there a way for me to save it into a PNG using a script because I will use another program to call it using a script. Unfortunately, d.mon is not working in order to make me use the d.out.file. –  teamAngat Feb 27 '11 at 15:40
    
d.mon x0 does not work too. It produced errors: ERROR: no such monitor 'x0' –  teamAngat Feb 27 '11 at 15:41

Use the d.* commands from the command-line window (which can be started alongside the GUI), or reconnect to your mapset with grass -text to get the command-line interface. You may want to also look at QGIS for more sophisticated display, it has a GRASS plugin which allows it to access GRASS layers. It includes a print composer that can generate sophisticated maps, including image output in various formats.

share|improve this answer
    
I used the GRASS 6.4.0 with MSYS in order to type in the command-line window. I tried running d.out.file but the error was: You must select a display monitor. I tried d.mon -l to list the monitors but I have no monitors. I tried d.mon start=1 but is displayed the error: there was no such monitor 1. I do not know how to start or create a monitor. –  teamAngat Feb 26 '11 at 18:12
    
Did you read my answer from Feb 27 at 9:21? –  markusN Mar 7 '11 at 16:17
    
@markusN: Yes I had read it. I was able to save the display using the graphical user interface to output into PNG files. But I cannot find a way to save a raster and vector (as one overlayed png file) without using the graphical user interface. –  teamAngat Mar 20 '11 at 5:17

Apparently you use the new graphical user interface (wxPython based). For this wxPython based interface, use the "Save display to graphics file" or "Print display" functionality from the icons bar on top of the map. See also the manual. See therein

  • Save display to graphic file
    • Save the visible image in map display to different raster graphic formats.
  • Print map
    • Prints map on system native printer or PostScript device; saves visible map display (including PostScript text and labels) to PDF or EPS file.
share|improve this answer
    
I was able to save it into a PNG file using the wxPython based graphical user interface. It would be better if I could save it into a PNG using a script because I will use another program to call it using a script. Unfortunately, d.mon is not working in order to make me use the d.out.file. –  teamAngat Feb 27 '11 at 14:51
    
d.mon is a completely different technology than the wxpython interface. I'll investigate for a scripted approach for the wxpython interface. –  markusN Feb 28 '11 at 13:23
1  
Updated: currently there is no scriptable approach in wxGUI but it is scheduled in future GRASS 7 development. –  markusN Feb 28 '11 at 15:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.