[GRASS-dev] [GRASS GIS] #63: r.los: patch to support earth curvature

#63: r.los: patch to support earth curvature
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Keywords: |
---------------------+------------------------------------------------------
Based on ideas from r.cva and prototype code from Andrea Antonello I have
added earth curvature support in r.los.
Please test.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Changes (by neteler):

  * type: defect => enhancement

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by neteler):

Any opinions on this?

http://trac.osgeo.org/grass/attachment/ticket/63/rlos_curv.diff

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by hamish):

{{{
r.los/main.c:
@@ -109,9 +114,13 @@
      opt6->type = TYPE_DOUBLE;
      opt6->required = NO;
      opt6->answer = "10000";
- opt6->options = "0-999999";
+ opt6->options = "0-9999999999";
      opt6->description = _("Maximum distance from the viewing point
(meters)");
}}}

Why increase that so much?
At the top of Everest, the maximum theoretical distance to the horizon
would be about 3.86*sqrt(8850) = 350km = 350,000m.
   http://mintaka.sdsu.edu/GF/explain/atmos_refr/horizon.html

make it 500000m?

Should all the new /* try to get the radius ... */ code live behind a
check for the -c flag? in case the proj stuff has problems.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by hopfgartner):

The observer might be on an airplane or other aircraft vehicel

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by hopfgartner):

Replying to [comment:4 hopfgartner]:
> The observer might be on an airplane or other aircraft vehicel

Earth radius might be the ultimative limit, as far as refraction is not
considered.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by pkelly):

I've no comment on the maths of the curvature stuff, but I think the code
to find the ellpisoid radius should simply use
G_get_ellipsoid_parameters() and all the PROJ_INFO parsing and checking
for invalid values etc. is taken care of then.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#63: r.los: patch to support earth curvature
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: fixed | Keywords:
--------------------------+-------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

I have simplified the ellipsoid stuff to:

{{{
    if (curvature->answer){
       /* try to get the radius the standard GRASS way from the libs */
       G_get_ellipsoid_parameters (&aa, &e2);
       if (aa == 0) {
           /* since there was a problem, take a hardcoded radius :frowning: */
           G_warning(_("Problem to obtain current ellipsoid parameters,
using sphere (6370997.0)"));
           aa = 6370997.00;
       }
       G_debug(3, "radius: %f", aa);
     }
}}}

Updated earth curvature patch submitted as [c30614]
(http://trac.osgeo.org/grass/changeset/c30614).

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/63#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/