Opened 6 years ago

Closed 6 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 Changed 6 years ago by pvanbosgeo

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 Changed 6 years ago by neteler

Changes which potentially cause this:

comment:3 Changed 6 years ago by hcho

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

comment:4 Changed 6 years ago by hcho

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.

comment:5 in reply to:  4 ; Changed 6 years ago by 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.

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

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.

comment:7 in reply to:  6 Changed 6 years ago by martinl

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.