[GRASS-dev] Re: m.distance / SWIG-Python interface + passing
pointers with SWIG [was: d.measure w/ bearing]
Moritz Lennert
mlennert at club.worldonline.be
Tue Mar 4 04:17:03 EST 2008
On 04/03/08 00:40, Hamish wrote:
>
> Agreed, I do not expect to move the (full) module to be an official
> module, I think it's too simple for that. It is just meant to be a
> fully working example, or could be used as an addon if someone needed a
> multi-segment geodesic distance/area calculator.
>
>
[...]
>
> I suppose you could say "programming" is not banned in the GUI (e.g. wx
> measurement or profile tool), but reimplementing complicated things
> like great circle calculations in the GUI when well tested and faster C
> versions already exist and are accessible via swig.
>
> For general use we would have to make the decision to make swig a
> mandatory dependency for the wxGUI. I think that opens more doors than
> it closes, so support the idea.
I'm not sure I fully agree with the above (and I think Dylan's right in
saying that we might need a more explicit discussion of the issue).
Besides issues concerning state which Glynn has mentioned often on this
list (but obviously I cannot find a reference now) and which might make
the direct use of GRASS function by the GUI a bit hazardous, there is a
fundamental choice to be made between only using modules or programming
directly with GRASS functions.
In my eyes the general rule should be that all functionality should be
available via modules from the command line if in any way possible. The
GUI should only provide additional help in things like determining
coordinates through mouse click and some (very limited) gui-specific issues.
This means that for the specific issue at hand, i.e. d.measure with
bearing, I strongly plead for adding the possibility of giving start /
end coordinates as parameters to the module. This would then allow other
uses beyond the wxgrass gui such as web apps, shell scripts, etc.
As I have mentioned before, I am afraid that slowly but surely the
wxgrass gui will multiply functionality which is only available via the
gui, but should, in my eyes, also be available from the command line.
I'm thinking of things like profiling, measuring, etc.
Moritz
More information about the grass-dev
mailing list