[GRASSLIST:7565] Re: Synergy between Grass/Python/GMT

Stephan Holl holl at gdf-hannover.de
Sat Jul 16 00:49:37 EDT 2005


Hello David, 

On Fri, 15 Jul 2005 16:27:18 -0700 David Finlayson
<david.p.finlayson at gmail.com> wrote:

> I've been working on a script to convert GRASS rasters directly into
> GMT plots in a single command. So far it converts the raster to GMT
> format, copies over the colormap and builds a simple graticule and
> scale bar. Works well.
> 
> In the process of building this script, however, I discovered there is
> some great synergy possible between IPython (the interactive python
> shell) and GRASS. Here is how it works:
> 
> 1) Launch ipython from within your grass shell
> 2) import a simple class designed to work with rasters
> 3) BINGO! you've got full control of command line grass + full
> interactive Python abilities.
> 
> The class I wrote for grass rasters contains a bunch of instance
> variables that hold basic info about the raster (resolution, bounding
> box, etc.) and some methods to ease interaction with Python, like a
> get_value(X, Y) method.

Would you like to share the python class which you wrote for
raster-maps?
It would be nice having the class in CVS to make it possible for others
too?

 Thanks for your comment

	Stephan

-- 
       ::ACHTUNG:: Neue Adresse und Telefonnummer ::ACHTUNG::

GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office      -     Mengendamm 16d      -     D-30177 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511.39088507       -        Fax: ++49-(0)511.39088508




More information about the grass-user mailing list