[GRASS5] [bug #837] (grass) g.remove

Glynn Clements glynn.clements at virgin.net
Fri Nov 16 19:17:50 EST 2001

Request Tracker wrote:

> it keeps telling me to remove a file that doesn't exist....
> $ g.list type=rast mapset=jidanni 
> ----------------------------------------------
> raster files available in mapset jidanni:
> pipeline
> ----------------------------------------------
> 0grass$ g.list type=rast mapset=jidanni |egrep -v :\|-|xargs -n 1 g.remove
> [pipeline at jidanni] is base map. Remove reclassed map first:
>  pipeline3 at jidanni
> 0grass$ g.remove pipeline3
> REMOVE [pipeline3]
>  raster   MISSING
>  header   MISSING
>  category MISSING
>  color    MISSING
>  history  MISSING
>  misc     MISSING
>  fcell    MISSING
>  g3dcell  MISSING

OK, pipeline3 doesn't exist now ...

> 0grass$ g.remove pipeline 
> [pipeline at jidanni] is base map. Remove reclassed map first:
>  pipeline3 at jidanni

... but it did once, and was presumably removed by means other than

Conclusion: if you remove a reclass map by means other than g.remove
(e.g. "rm"), you can't remove the base map with g.remove.

If this is a problem, the half-baked attempt at tracking reclass maps
will need to go altogether.

Note: g.remove cannot reasonably be made to remove "reclassed_to"
entries for reclass maps which no longer exists.

Under normal circumstances g.remove:

1. calls G_is_reclass() to determine the base map from the reclass
map's "cellhd" file.
2. calls G_is_reclassed_to() for the base map to verify the reclass.
3. removes the reclass map from the base map's "reclassed_to" file.
4. deletes the reclass map's files.

Once the reclass map's files have been deleted, G_is_reclass() won't
work, and can't work (at least, not without checking every
"reclassed_to" file which it can find).

This is just user error, so I'm changing this to "resolved".

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list