[GRASS-user] passing raster map to Python object

Milton Cezar Ribeiro miltinho.astronauta at gmail.com
Wed Aug 12 02:53:58 EDT 2009


Hi Hamish,

Thanks for your encourager's email.
I started to play with numpy for other purposes,
but I will give a look in deep for this.

If I get success I will be happy report it here.

bests

milton

2009/8/12 Hamish <hamish_b at yahoo.com>

>  Milton Cezar Ribeiro wrote:
> > I am building a simulation python code that read a
> > raster maps on grass mapset.
> > As my maps is not so large (512x512 pixels) I dump it
> > on a text file
> > (using r.out.ascii), after I read the text file on
> > python, parse it using a function that
> > I wrote, and after create a matrix-like object on Python.
> >
> > I would like to know if I can read my raster map on python wihout
> > save it on external text file. Case yes, a short example are welcome.
>
>
> you might look at NumPy  http://numpy.scipy.org/ + NumPtr python
> extension. NumPtr can be found in the swig/python/ dir in the grass
> source code. (also examples/m.distance + rasteraccess.py there)
>
> NumPy is also used by the wxGUI profile tool.
>
>
> SciPy is another thing to check out.
>
>
> please post back to the list with what you learn :) & if you succeed
> maybe add a page to the grass wiki with steps?
>
>
> Hamish
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090812/9f1717d8/attachment.html


More information about the grass-user mailing list