[GRASS5] r.profile and LatLong coords input?

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

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@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

Thanks, Bob,

that does the trick. Updated in 6.1-CVS.
(there were two more lines to change).

Markus

On Mon, Oct 24, 2005 at 10:12:50AM -0300, Bob Covill wrote:

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@grass.itc.it
>http://grass.itc.it/mailman/listinfo/grass5
>
>

--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy