[GRASS-dev] r.digit

Pietro peter.zamb at gmail.com
Mon Dec 17 01:00:46 PST 2012


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


More information about the grass-dev mailing list