[GRASS-user] ps.map with interactive map instructions using python

Johannes Radinger johannesradinger at gmail.com
Mon Mar 4 02:09:26 PST 2019


Hi all,

I want to use ps.map in python to create *.eps maps from a GRASS vector
line using some interactive mapping instructions, i.e. I don't want to save
my mapping instructions into a *.txt file but rather provide the
instructions as a python string.

For example my mapping instructions:
map_instructions = """
# my instructions
vlines my_lines
  type line
  layer 2
  color color
  rgbcolumn rgb_column
  width 2
  end
"""
# And now I'd like to use this string as input to ps.map within a python
command:
grass.run_command("ps.map",
  flags="e",
  input="-",
  stdin_=map_instructions,
  output="myoutput.eps")

However, stdin is not the correct way to specify this...what would be the
correct way to avoid saving the instructions as text but rather using the
python text-string as direct input to ps.map within python? At least the
GUI of ps.map allows to use interactive input for mapping instructions...
Any suggestions?

Cheers,
Johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190304/0978ab75/attachment.html>


More information about the grass-user mailing list