0

I'm trying to run a script from the GRASS WiKi to create a simple map using ps.map. I'm confused because it's generating an error that the output was not set, when it appears to me that it is set at the beginning of the script. The script and error follow. The first code box contains the contents of the file spearfish.map, which is referenced as the input value in the second code box.

# Simple ps.map example using the Spearfish dataset
g.region rast=elevation.10m

ps.map output=spearfish.ps << EOF
paper us-letter
  end
scale 1:120000
raster elevation.10m
colortable
  where 2 6.75
  end
text 50% -7% Spearfish County, ND (Mount Rushmore)
  fontsize 16
  end
mapinfo
  where 4.5 7.25
  end
vlines roads
  where label ~ 'highway' OR label = 'interstate'
  color grey
  end
vpoints archsites
  symbol basic/triangle
  end
end
EOF

The command for running the script and the error it generates are below:

> ps.map input=spearfish.map                                                     
ERROR: Required parameter <output> not set:
    (PostScript output file)

UPDATE: Based on ShaunLangley's comment, I tried ps.map output=out.map. This seems to have started ps.map in interactive mode and I was able to enter the rest of the script one line at a time. That did create a map as a postscript file, so I'm headed in the right direction. I'll close this thread as solved and open a new one more targeted on the question of how to run the commands as a script.

1
  • You did not give the Wiki URL nor your GRASS version...
    – markusN
    Commented Mar 21, 2013 at 23:46

1 Answer 1

1

the ps.map function requires you specify output. The example you have:

> ps.map input=spearfish.map

doesn't specify the output variable. I'm not sure what the distinction between the code boxes is. The former should work because the input raster is defined with "raster" and output defined at the top. It looks like you're trying to replicate an example; is this correct?

Perhaps you could try:

ps.map input=elevation.10m output=spearfish.map

You can specify the additional options as well just as the code example did.

1
  • 1
    I should have specified that the second code box is the content of the file spearfish.map, which is the input value in the first code box. Unless I'm misunderstanding the ps.map input command, the output should be correctly specified in that file.
    – Gregory
    Commented Mar 21, 2013 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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