[GRASS-dev] Re: [GRASS-user] XY trace plots

Hamish hamish_b at yahoo.com
Sun May 20 17:04:10 EDT 2012


[moved to -dev list]

Markus Metz wrote:
> The argument must be a pointer, try
> 
> G_is_null_value(byref(in_rast[col]), data_type)
> 
> or
> in_val = in_rast[col]
> G_is_null_value(byref(in_val), data_type)

no joy, both those come back with:

    if not G_is_null_value(byref(in_rast[col]), data_type):
TypeError: byref() argument must be a ctypes instance, not 'int'

(tried with a CELL map)

https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.to.vect.lines/r.to.vect.lines.py#L155


the cast happens early on at malloc time,
 in_fd   = G_open_cell_old(inmap, mapset)
 in_rast = G_allocate_raster_buf(data_type)
 in_rast = cast(c_void_p(in_rast), ptype)

right after data_type is determined.
here ptype = POINTER(c_int)


?,
Hamish


More information about the grass-dev mailing list