[GRASS5] [bug #992] (grass) g.region Vask problem in lat/long

Glynn Clements glynn.clements at virgin.net
Wed Mar 27 13:26:07 EST 2002


Request Tracker wrote:

> Subject: g.region Vask problem in lat/long
> 
> Platform: GNU/Linux/i386
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> 
> Working in lat/long location, I found a small (unusual) error:
> 
> GRASS:~ > g.region -p

Can you tell us the default region (rather than the current region),
as it seems to be the default West value that's causing the problem.

> Now starting g.region, selecting menu 1:
> V_ask error: Length out of bounds in call to V_const           <- this warning appears for 3 sec

> The west value makes me unhappy. Looks like a rounding problem somewhere.

Well, floating point can't represent exactly fractions where the
denominator isn't a power of two, so rounding errors will occur.

G_lon_format() (which generates the string in question) doesn't use
any specific precision, so you get the standard behaviour of "%f",
which is 6 digits after the point.

But how many digits should it use? Are whole seconds sufficiently
accurate? Unless you require accuracy better than thousandths of a
second, the argument should be converted to seconds and integer
arithmetic used.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list