[GRASS5] [bug #4311] (grass) shaded relief parameter checking

this bug's URL: http://intevation.de/rt/webrt?serial_num=4311
-------------------------------------------------------------------------

Subject: shaded relief parameter checking

Platform: GNU/Linux/x86_64
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 6.1

There is a bug in r.shaded.relief where the input parameters are
checked, especially the azimuth.

the current version reads:

if test $alt -lt 0 -o $alt -gt 90
then
        echo "Sorry, altitude must be greater than 0 and less than 90"
        exit 1
fi

if test $az -lt 0 -o $alt -gt 360
then
        echo "Sorry, azimuth must be between 0 and 360"
        exit 1
fi

and it should be according to the text description

if test $alt -lt 1 -o $alt -gt 89
then
        echo "Sorry, altitude must be greater than 0 and less than 90"
        exit 1
fi

if test $az -lt 0 -o $az -gt 360
then
        echo "Sorry, azimuth must be between 0 and 360"
        exit 1
fi

-------------------------------------------- Managed by Request Tracker

I changed the sun angle check error message to match the documentation and
the script code. See below.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Request Tracker <grass-bugs@intevation.de>
Reply-To: Request Tracker <grass-bugs@intevation.de>
Date: Wed, 19 Apr 2006 17:50:50 +0200 (CEST)
To: <grass5@grass.itc.it>
Subject: [GRASS5] [bug #4311] (grass) shaded relief parameter checking

this bug's URL: http://intevation.de/rt/webrt?serial_num=4311
-------------------------------------------------------------------------

Subject: shaded relief parameter checking

Platform: GNU/Linux/x86_64
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 6.1

There is a bug in r.shaded.relief where the input parameters are
checked, especially the azimuth.

the current version reads:

if test $alt -lt 0 -o $alt -gt 90
then
        echo "Sorry, altitude must be greater than 0 and less than 90"

changed to "Sorry, altitude must be between 0 and 90"

        exit 1
fi

if test $az -lt 0 -o $alt -gt 360
then
        echo "Sorry, azimuth must be between 0 and 360"
        exit 1
fi

> this bug's URL: http://intevation.de/rt/webrt?serial_num=4311
> -------------------------------------------------------------------
> ------
>
> Subject: shaded relief parameter checking

..

> There is a bug in r.shaded.relief where the input parameters are
> checked, especially the azimuth.
>
> the current version reads:
> ================
> if test $alt -lt 0 -o $alt -gt 90
> then
> echo "Sorry, altitude must be greater than 0 and less than
> 90"

changed to "Sorry, altitude must be between 0 and 90"

> exit 1
> fi
>
> if test $az -lt 0 -o $alt -gt 360

           ^^^^ ^^^^
actually this was the error.

> then
> echo "Sorry, azimuth must be between 0 and 360"
> exit 1
> fi

Anyway, those checks should have been in the parameter setup as
#% options : 0-90
to let the parser do its job.

so I've moved them there for both 6.1 and 6.0.x CVS branches.

For this module out-of-bounds values don't fail, so 0-90 or 1-89 really
didn't matter to the output. I think the description was changed to
odd numbers to reflect the broken >,< tests?

also did a few more cleanups in the 6.1 branch. (record metadata, etc)

Hamish

I see it now. It wasn't clear to me in the bug report.

Thanks for fixing it.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Thu, 20 Apr 2006 15:32:16 +1200
To: Michael Barton <michael.barton@asu.edu>
Cc: <grass-bugs@intevation.de>, <grass5@grass.itc.it>
Subject: Re: [GRASS5] [bug #4311] (grass) shaded relief parameter checking

this bug's URL: http://intevation.de/rt/webrt?serial_num=4311
-------------------------------------------------------------------
------

Subject: shaded relief parameter checking

..

There is a bug in r.shaded.relief where the input parameters are
checked, especially the azimuth.

the current version reads:

if test $alt -lt 0 -o $alt -gt 90
then
        echo "Sorry, altitude must be greater than 0 and less than
        90"

changed to "Sorry, altitude must be between 0 and 90"

        exit 1
fi

if test $az -lt 0 -o $alt -gt 360

           ^^^^ ^^^^
actually this was the error.

then
        echo "Sorry, azimuth must be between 0 and 360"
        exit 1
fi

Anyway, those checks should have been in the parameter setup as
#% options : 0-90
to let the parser do its job.

so I've moved them there for both 6.1 and 6.0.x CVS branches.

For this module out-of-bounds values don't fail, so 0-90 or 1-89 really
didn't matter to the output. I think the description was changed to
odd numbers to reflect the broken >,< tests?

also did a few more cleanups in the 6.1 branch. (record metadata, etc)

Hamish