Opened 16 years ago
Closed 16 years ago
#63 closed enhancement (fixed)
r.los: patch to support earth curvature
| Reported by: | neteler | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 6.4.0 |
| Component: | Default | Version: | svn-trunk |
| Keywords: | Cc: | andrea.antonello@… | |
| CPU: | Unspecified | Platform: | Unspecified |
Description
Based on ideas from r.cva and prototype code from Andrea Antonello I have added earth curvature support in r.los. Please test.
Markus
Attachments (1)
Change History (8)
by , 16 years ago
| Attachment: | rlos_curv.diff added |
|---|
comment:1 by , 16 years ago
| Type: | defect → enhancement |
|---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
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.
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
follow-up: 5 comment:4 by , 16 years ago
The observer might be on an airplane or other aircraft vehicel
comment:5 by , 16 years ago
Replying to 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.
comment:6 by , 16 years ago
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.
comment:7 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
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 :( */
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

Any opinions on this?
http://trac.osgeo.org/grass/attachment/ticket/63/rlos_curv.diff
Markus