[GRASS-dev] r.digit

Pietro peter.zamb at gmail.com
Mon Dec 17 03:23:46 PST 2012


HI,

On Mon, Dec 17, 2012 at 11:46 AM, Vaclav Petras <wenzeslaus at gmail.com> wrote:
> On 17 December 2012 10:58, Mohammed Rashad <mohammedrashadkm at gmail.com> wrote:
>> All,
>>
>> What I am thinking of is a python version of r.in.poly which can create
>> area, line, circle from a list of (x,y) coordinates captured from wxGUI Map
>> display
>>
>> r.in.poly reads from file or stdin. Using pyGRASS/ grass ctypes api we can
>> create objects in raster file.
>>
> But keep in mind that GUI should not call grass C libraries directly
> but should call modules if possible. Digitizer is now one of the
> exceptions. But we should avoid adding more exceptions, I think.

ok, pygrass Module object, it suppose to work with stdin, but is not
ready yet... I hope to finish this part at the beginning of the new
year, and should work in this way:

>>> from pygrass.modules import raster as r
>>> area = """A
...   591316.80   4926455.50
...   591410.25   4926482.40
...   591434.60   4926393.60
...   591341.20   4926368.70
... = 42 stadium"""
>>> r.in_poly(input='-', output='rtest', stdin_=area)

But you have to wait...

Pietro


More information about the grass-dev mailing list