Opened 10 years ago

Closed 10 years ago

#2546 closed defect (fixed)

unable to remove raster map after using it as a mask

Reported by: martinl Owned by: hcho
Priority: blocker Milestone: 7.0.0
Component: Raster Version: svn-trunk
Keywords: mask, remove, reclass Cc:
CPU: Unspecified Platform: Linux

Description

Steps to reproduce this bug:

g.region rast=ofoto.alpha
r.mask raster=ofoto.alpha mask=0 -i
r.mask -r

Even the mask has been removed, it's not possible to remove raster map ofoto.alpha:

g.remove rast name=ofoto.alpha -f
WARNING: Raster map <ofoto.alpha@OstrovaciceHrbitov> is a base map. Remove reclassed map <MASK@OstrovaciceHrbitov> first.

Change History (7)

comment:1 by pvanbosgeo, 10 years ago

I can confirm this. As mentioned in an email a few days ago, even if the MASK is removed already, in the GRASSdb/location/mapset/cell_misc/rastername there is the file 'reclassed_to' which contains the pointer to the MASK. Removing this file solves the problem.

comment:2 by neteler, 10 years ago

Changes which potentially cause this:

comment:3 by hcho, 10 years ago

Owner: changed from grass-dev@… to hcho
Status: newassigned

comment:4 by hcho, 10 years ago

Related commits: r64131, r64132, r64133, r64135, r64136

r.mask -i first creates a reclassified MASK map and renames it to a temporary map. Then, it creates a non-reclass MASK map based on the temporary map. This issue occurs when g.rename renames MASK to a temp name because g.rename is not updating reference info in the reclassed_to file for the base raster map at all.

The above commits should fix this issue. Please test it again.

in reply to:  4 ; comment:5 by martinl, 10 years ago

Replying to hcho:

The above commits should fix this issue. Please test it again.

I can confirm, it seems to be fixed. Thanks for super-quick fix. It's hot candidate for backport.

in reply to:  5 ; comment:6 by hcho, 10 years ago

Replying to martinl:

Replying to hcho:

The above commits should fix this issue. Please test it again.

I can confirm, it seems to be fixed. Thanks for super-quick fix. It's hot candidate for backport.

Done in r64140.

in reply to:  6 comment:7 by martinl, 10 years ago

Resolution: fixed
Status: assignedclosed

Replying to hcho:

Done in r64140.

Thanks, tested. I am taking liberty to close this ticket. Please feel free to re-open if needed.

Note: See TracTickets for help on using tickets.