[GRASSGUI] wxgrass: histogram and profile

Michael Barton michael.barton at asu.edu
Tue Jun 5 11:12:56 EDT 2007


Thanks for the detailed explanation. Is this a caution in general about
using libgis via SWIG or more about this specific kind of information?

Michael


On 6/5/07 7:56 AM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

> 
> Markus Neteler wrote:
> 
>>>> # concering distance measure:
>>>> I feel that the result in latlong is degree or so - could this be changed
>>>> to metric output (like d.measure does with
>>>> G_begin_distance_calculations())?
>>> 
>>> This is a very good idea. But how can we get distance in meters from the
>>> map? Anyone?
>> 
>> libgis offers such function (see d.histogram). Time to get the
>> SWIG interface working :)
> 
> I would advise against using libgis (via SWIG) in the GUI. The design
> of libgis is entirely unsuited to persistent applications.
> 
> For example:
> 
> 1. G_begin_distance_calculations() obtains the projection using
> G_projection().
> 
> 2. G_projection() obtains the current window using G_get_set_window(),
> and returns the projection field.
> 
> 3. G_get_set_window() returns G__.window, after calling
> G__init_window() to initialise it.
> 
> 4. G__init_window() calls G_get_window() if the window isn't already
> set. If it is set, it does nothing.
> 
> If the GUI changes locations while running, the distance functions
> would continue using the original projection, unless you manually
> reset G__.window. And you can't use G_get_window() to read the WIND
> file etc, as that just returns G__.window once it has been set.
> 
> More generally, there are just too many variables which get
> initialised once and cannot subsequently be reset. This isn't a
> problem for normal modules, but it's a fundamental problem for a GUI.

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-gui mailing list