#975: WxGUI should provide area measurement tool
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: default | Version: unspecified
Keywords: | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Most of GUI GIS programs provide area measurement tools. Current wxgui
version provides only line length measurement (which is cool).
As area calculations can be tricky, it should use some of lib/gis(?)
function via some module.
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by cmbarton):
Well, if d.measure had the architecture to accept coordinate pairs and
return line lengths and areas defined by the coordinate pairs, this would
have been easy to implement in the GUI.
BUT, d.measure ran as a persistent process that only accepted input from
interactive drawing in an xterm emulation environment.
So, measurement has had to be recreated entirely in Python/wxPython. And
as you say, area calculations are tricky.
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):
Replying to [comment:3 cmbarton]:
> BUT, d.measure ran as a persistent process that only accepted input from
interactive drawing in an xterm emulation environment.
>
> So, measurement has had to be recreated entirely in Python/wxPython. And
as you say, area calculations are tricky.
So do you want me to recycle d.measure into g.measure?
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):
can swig/python/examples/m.distance.py (or swig in general) be used by the
core wxgui.py? if so, there is very little left to do. if not I guess we
need a C version of it.
even if swig errors can not be caught directly, m.distance.py as a
separate program probably could be caught when called from wxgui.py. (?)
same question is true for gui/wxpython/gui_modules/units.py and probably a
lot of other stuff which should be handled by libgis instead of
reimplemented from scratch in the GUI code.
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):
Replying to [comment:5 hamish]:
> can swig/python/examples/m.distance.py (or swig in general) be used by
the core wxgui.py? if so, there is very little left to do. if not I guess
we need a C version of it.
SWIG is not a mandatory dependency. IMO, it should remain that way, given
that SWIG is not particularly well documented and seems to be relatively
unstable.
IOW, important functionality must not depend upon the existence of the
SWIG bindings in grass.lib.
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):
Glynn:
> IOW, important functionality must not depend upon the existence
> of the SWIG bindings in grass.lib.
so we need to port m.distance.py to C. ok; swigged python -> should be
pretty easy.
(fwiw my 2c naming preference is to use g.* for Gis support things (eg
g.findfile) and m.* for geoMath things (eg m.cogo, m.proj), and so
m.{distance|measure} instead of g.*)
> SWIG is not particularly well documented and seems to be
> relatively unstable.
It occurs to me that we are a bit spoiled by our long-time use of hyper-
mature ANSI C and tcl/tk. wx and even python are still evolving very fast
by comparison.
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by cmbarton):
I've been mostly out of the loop--demo-ing GRASS 7 at UCL--but have
followed a bit on this. Ideally, for this and some other functions that
we've had to recreate in the GUI, it would be better to have a GRASS
module. I suppose I agree with the m.* for the name argument (though I
don't have especially strong feelings about it). It will take some
rewriting to integrate such functions now, but ultimately worthwhile.
I don't remember what all d.measure did, however. The current GUI
implementation gives: segment length, segment bearing, total multisegment
length, and has a nice (and easily parsable) output format. Does d.measure
do that? For area, is it only calculated for closed polygons or for open
ones too?
#975: WxGUI should provide area measurement tool
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: d.measure
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):
Replying to [comment:9 cmbarton]:
> I don't remember what all d.measure did, however. The current GUI
implementation gives: segment length, segment bearing, total multisegment
length, and has a nice (and easily parsable) output format. Does d.measure
do that? For area, is it only calculated for closed polygons or for open
ones too?
d.measure (now m.measure in 7.0) calculates the cumulative length obtained
from passing each pair of adjacent points to G_distance() and, if 3 or
more points are given, the area from G_area_of_polygon().
There should probably be an option to include the distance between the
last and first points, i.e. calculate the perimeter. Currently, for N
points it calculates the length for N-1 segments; if you want the
perimeter, you have to duplicate the first point as the last point.