[GRASS5] r.profile and LatLong coords input?

Bob Covill bcovill at tekmap.ns.ca
Mon Oct 24 09:12:50 EDT 2005


Markus,

It looks like profile coordinates provided on the command are NOT being 
parsed with G_scan_... . They are being parsed with sscanf which will 
not work with the sexagesimal format.

If you replace the following lines in main.c (r.profile)

sscanf(parm.profile->answers[i], "%lf", &e1);
sscanf(parm.profile->answers[i + 1], "%lf", &n1);
sscanf(parm.profile->answers[i + 2], "%lf", &e2);
sscanf(parm.profile->answers[i + 3], "%lf", &n2);

with

G_scan_easting(parm.profile->answers[i], &e1, G_projection());
G_scan_northing(parm.profile->answers[i+1], &n1, G_projection());
G_scan_easting(parm.profile->answers[i+2], &e2, G_projection()); 
         G_scan_northing(parm.profile->answers[i+3], &n2, G_projection());

that should take care of the problem.

--
Bob


Markus Neteler wrote:
> Hi,
> 
> I tried to use the current r.profile do compare SRTM V1 and
> the new SRTM V2 in a LatLong location. Unfortunately coordinate
> input in sexagesimal format didn't produce any output while
> decimal degree input does:
> 
> r.profile N46E011_V1 profile=11:09:19.694051E,46:10:38.328612N,11:09:19.694051E,46:02:38.328612N
> -> nothing, but also no error
> 
> r.profile N46E011_V1 profile=11.15524237,46.17754171,11.15524237,46.04062008
> -> results
> 
> Any ideas? G_scan_easting() and G_scan_northing() seem to be used.
> 
> Markus
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
> 
> 




More information about the grass-dev mailing list