[GRASS-dev] python read raster cell

Mohammed Rashad rashadkm at yahoo.com
Sat Jul 31 23:05:59 EDT 2010


my code is this:
inrast = []
inrast = grass.G_allocate_cell_buf()
grass.G_get_raster_row(infd,  inrast[0], 0, self.data_type) 

and print inrast[0] gives me
Swig  Object of type 'int *' at 0x972d560>
inrast is a list of integer  arrays
how can i access each element of inrast[0]
What  i need to  read element using inrast[0][0], inrast[0][1], 
inrast[0][2].      etc..
Is  this possible. If yes what should I do to achieve this ?

Do I need to write a swig interface if inrast[0] is swig Object of type int* and 
inrast[0][0] is of type int?

 --
Rashad



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20100731/ca819dc5/attachment.html


More information about the grass-dev mailing list