[GRASS-dev] r.digit

Mohammed Rashad mohammedrashadkm at gmail.com
Mon Dec 17 01:58:23 PST 2012


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.




On Mon, Dec 17, 2012 at 2:30 PM, Pietro <peter.zamb at gmail.com> wrote:

> Hi Hamish,
>
> On Mon, Dec 17, 2012 at 4:36 AM, Hamish <hamish_b at yahoo.com> wrote:
> > for my 2c it's quite nice to have a dedicated raster digitizing
> > option, instead of needing an extra v.in.ascii -> v.to.rast
> > step in your workflow. That doesn't rule out a wrapper script
> > to hide the vector part of it, but a dedicated r.in.poly mode
> > would both be more efficient and perhaps less prone to loss in
> > fidelity.
>
> I think that should be possible to use the geometry feature of the
> vector api of pygrass,
>
> >>> from grass import pygrass
> >>> from pygrass.vector.geometry import Point, Line
> >>> pnt = Point(10, 100)
> >>> line = Line([(0, 0), (1, 1), (2, 0), (1, -1)])
> >>> line.c_points  # return the ctypes pointer to the line_points struct
> <grass.lib.ctypes_preamble.LP_struct_line_pnts object at 0x2aa1440>
>
> even if is not deeply tested...
>
> get more example from here:
>
>
> http://www.ing.unitn.it/~zambelli/projects/pygrass/vector.html#vector-features
>
>
> Pietro
>



-- 
Regards,
   Rashad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20121217/3fb0b8e6/attachment.html>


More information about the grass-dev mailing list