[GRASS-user] OFF-TOPIC - Earth Curvature in profiles

Markus Neteler neteler at osgeo.org
Sun Jan 13 02:36:27 EST 2008


On Jan 10, 2008 10:06 PM, Carlos Guâno Grohmann
<carlos.grohmann at gmail.com> wrote:
> Sorry for the OT, but can anyone point me some reference (paper, web,
> etc) that explains how can I draw a topographic profile using the
> Earth´s curvature? I am thiking about the output of r.profile (ascii,
> distance from origin + elevation), in a section of about 3000 km, with
> a vertical exaggeration of about 200 times.

Carlos,

if you want to correct r.profile for Earth´s curvature, see e.g. r.cva.
In essence, something like this code extracted from r.cva:

double DIST_CC;
double dest_elev;
double Re;


struct Option curvature_corr;
curvature_corr = G_define_option ();
curvature_corr->key = "curvc";
curvature_corr->type = TYPE_DOUBLE;
curvature_corr->required = NO;
curvature_corr->answer = "0.0";
curvature_corr->description = "Earth curvature correction threshold
(0.0 = off)";

Re = 6356766.0; / radius of Earth in m /
dist = sqrt(del_x*del_x +del_y*del_y) * window.ns_res;
DIST_CC = atof (curvature_corr->answer);

/* CURVATURE CORRECTION */
/* decrease height of target point */
if (DIST_CC > 0.0) {
    if (dist >= DIST_CC) {
    dest_elev = dest_elev - ((dist*dist) / (2 * Re));
   }
}

http://www.ucl.ac.uk/~tcrnmar/downloads/AdvancedViewshedAnalysis.tar.gz
file  pts_elim3.c

AFAIK also r.sun contains such code.

Markus


More information about the grass-user mailing list