[GRASSLIST:4488] Re: r.mapcalc and alternate mapsets.

Eric G. Miller egm2 at jps.net
Thu Sep 12 22:34:26 EDT 2002


On Fri, Sep 13, 2002 at 01:38:19AM +0100, Glynn Clements wrote:

> What's going on is that G_raster_map_type() uses G_find_file(), which
> "helpfully" strips the "@mapset" part from its argument. Damn.

Yea, some of that mapset code is pretty circuituous...

> Given that GRASS comprises around 400 programs, there's a non-zero
> chance that one or both of the following are true:
> 
> 1. Other programs also call G_raster_map_type() without allowing for
> the fact that it strips the mapset from the name (i.e. this bug may
> well exist in other programs).
> 
> 2. One or more programs rely upon it behaving this way, so we can't
> just change the call to use G_find_file2 (which doesn't do this)
> instead of G_find_file (which does) without analysing every single
> program which uses it.

Most programs I've looked at, explicitly lookup the mapset early
in the process and store the result:

  mapset = G_find_file ("rast", input->name, "");
  if (mapset == NULL) G_fatal_error ("foo");

> Damn. Damn. Damn. Damn. Damn. Damn.
> 
> Some days I look forward to being able to clean up all of this sort of
> cruft in 5.1/6.0. And other days I wonder if the rot is too deep and
> that the only solution is to raze the whole damn thing to the ground
> and start again. Today is in the second category.

I can sympathize...

-- 
begin 664 .signature
M<F5L;&E-("Y'(&-I<D4@/G1E;BYS<&I`,FUG93P)"`@("`@("`@("`@("`@(
M"`@("`@("`@("`@("`@("`A%<FEC($<N($UI;&QE<B`\96=M,D!J<',N;F5T
"/@H`
`
end



More information about the grass-user mailing list