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

Hamish hamish_nospam at yahoo.com
Wed Apr 19 23:32:16 EDT 2006


> > 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




More information about the grass-dev mailing list