[GRASS-user] Problems Running r.flow

Hamish hamish_b at yahoo.com
Fri Jan 29 00:22:02 EST 2010


> Glynn wrote:
> > Try the attached patch. It replaces the exact comparison
> > with a check that the resolutions agree to within 1ppm.
> ...
> > +static int compare_regions(const struct Cell_head *a,
> const struct Cell_head *b)
> > +{
> > +    return (fabs(a->ew_res - b->ew_res) < 1e-6 * b->ew_res &&
> > +        fabs(a->ns_res - b->ns_res) < 1e-6 * b->ns_res);
> > +}

Hamish:
> use GRASS_EPSILON, as it is based on the machine; it
> doesn't make assumptions about the units you are measuring in.
...
> e.g. for Lat/Long 1e-6 is not enough to accurately
> represent the
> region resolution well for sub-meter data. (1e-6*1852*60
> => ~ 11cm)


sorry reading again you did say ppm not micron and the code is 1e-6*res,
not simply 1e-6.


a plausible finest resolution of 1e-9 for lat/lon (~.1mm) * 1e-6 = 1e-15
(which is identical GRASS_EPSILON).


Hamish



      


More information about the grass-user mailing list