[GRASS-user] How to find out an angle between to points on the map (for r.plane, r.lake)

Michael Barton michael.barton at asu.edu
Sat Mar 1 10:53:18 EST 2008


On Mar 1, 2008, at 8:41 AM, Martin Landa wrote:

> Hi,
>
> 2008/3/1, Michael Barton <michael.barton at asu.edu>:
>> Well, my understanding of the direction of GRASS is that by v7, we'll
>>  lose all the interactive xterm-specific d.* modules. Interactive use
>>  will all be shifted to whatever GUI we design, rather than being  
>> hard-
>>  coded into a module. Simple, interactive measurement between 2  
>> points
>>  on a display screen seems to me something to be handled by a GUI.
>>
>>  d.measure will go away OR change to a module in which you enter a
>>  start and end point and it returns the distance between the points.
>>  In the latter case, it could then be 'plugged into' a GUI as a
>>  function to calculate distance between points interactively  
>> 'grabbed'
>>  by the GUI.
>
> In that case I would vote for `g.measure coords=` or something
> similar. Then this module could be used in GUI (not matter which one)
> or directly from CLI. Or in wxPython to use Python SWIG interface
> (need to be improved) to use gislib for distance calculation and
> similar.
>
>>  Ignoring geodetic distance for LL projections is simply ignorance  
>> (on
>>  my part here) of the equations needed to do it. It's easy to
>>  determine if a location is LL. In that case, it should calculate
>>  geodetic distance rather than (or perhaps in addition to) displaying
>>  distance in map units. Just need to have the functions to do this
>>  added to the measurement methods.
>
> why to code it in Python when it is already available in gislib? We
> should avoid code duplication.

Certainly. If a new version of d.measure or a hypothetical g.measure  
could be created, we could use that. Until that happens, we'll need  
to do it in Python (which is not all that bad). Is there anyway to  
access gislib directly from Python? This could be an alternative to  
creating a new module or changing an existing one.

Michael



More information about the grass-user mailing list