[GRASS-user] python pipe Popen to grass.<?>_command

Peter Tittmann ptittmann at gmail.com
Thu Feb 17 20:36:58 EST 2011


I'm attempting to pipe the results from:
pts=sub.Popen('las2txt -i %s --parse xyz --keep-classes 2 --delimiter "|" --stdout'%path, shell=True, stdout=sub.PIPE)

to the appropriate grass.?_command('r.in.xyz', etc...)

i've tried the following:

mkInRast=grass.feed_command("r.in.xyz", input=pts.communicate()[0], output='tester', method='mean')

which results in:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/grass64/etc/python/grass/script/core.py", line 198, in feed_command
return start_command(*args, **kwargs)
File "/usr/lib/grass64/etc/python/grass/script/core.py", line 148, in start_command
return Popen(args, **popts)
File "/usr/lib/grass64/etc/python/grass/script/core.py", line 53, in __init__
startupinfo, creationflags)
File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 7] Argument list too long

Im pretty sure i'm missing something about how the Popen pipes are accessed between these two commands. Any suggestions would be most welcome.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20110217/57357e52/attachment.html

More information about the grass-user mailing list