[GRASS-dev] [GRASS GIS] #1718: r.resamp.rst broken in GRASS 7

#1718: r.resamp.rst broken in GRASS 7
-------------------------+--------------------------------------------------
Reporter: rsbivand | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Running r.resamp.rst fails in 7, succeeds in 6.4.2. In 6.4.2, spearfish,
with region set to elevation.dem, this works:

r.resamp.rst --overwrite --verbose input=elevation.dem@PERMANENT ew_res=15
ns_res=15 elev=elev15
Processing all selected output files will require
4719648 bytes of disk space for temp files.
Temporarily changing the region to desired resolution ...
Changing back to the original region ...
Percent complete:
dnorm in ressegm after grid before out2= 388.844442
dnorm in mainc after grid before out1= 388.844442
dnorm in mainc after grid before out2= 388.844442
Temporarily changing the region to desired resolution...
Changing the region back to initial...
r.resamp.rst complete.

In 7 (latest svn up), with region set to elevation.dem:

r.resamp.rst --overwrite --verbose input=elevation.dem@PERMANENT ew_res=15
ns_res=15 elev=elev15
Processing all selected output files will require
4.50 MB of disk space for temp files.
Temporarily changing the region to desired resolution ...
ERROR: Input window changed while maps are open for read

The error message comes from lib/raster/set_window.c, but the cause may be
in raster window handling logic 6/7. This seems to cut in about line 480
in raster/r.resamp.rst/main.c:

     Rast_set_window(&outhd);

which calls:

     update_window_mappings();

in the library file cited, and triggers the error.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1718&gt;
GRASS GIS <http://grass.osgeo.org>

#1718: r.resamp.rst broken in GRASS 7
--------------------------+-------------------------------------------------
Reporter: rsbivand | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.resamp.rst | Platform: All
      Cpu: Unspecified |
--------------------------+-------------------------------------------------
Changes (by neteler):

  * keywords: => r.resamp.rst
  * platform: Unspecified => All
  * component: Default => Raster

Comment:

A discussion on this matter is found in trac #1576.

(I m not sure how to fix this bug)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1718#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1718: r.resamp.rst broken in GRASS 7
--------------------------+-------------------------------------------------
Reporter: rsbivand | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.resamp.rst | Platform: All
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by neteler):

Citation from grass-dev:

In 7.x, the RST library isn't working because it hasn't been updated
for the new raster window handling (r40772 etc)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1718#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1718: r.resamp.rst broken in GRASS 7
--------------------------+-------------------------------------------------
Reporter: rsbivand | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.resamp.rst | Platform: All
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by neteler):

See also ticket #1775

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1718#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1718: r.resamp.rst broken in GRASS 7
--------------------------+-------------------------------------------------
Reporter: rsbivand | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.resamp.rst | Platform: All
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mmetz):

Fixed in trunk r59739 and relbr70 r59740.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1718#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1718: r.resamp.rst broken in GRASS 7
-----------------------+----------------------------------------------------
  Reporter: rsbivand | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch70
Resolution: fixed | Keywords: r.resamp.rst
  Platform: All | Cpu: Unspecified
-----------------------+----------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * version: svn-trunk => svn-releasebranch70
  * resolution: => fixed

Comment:

Tested successfully in current 7.0.svn:

{{{
GRASS 7.0.0svn (spearfish60_grass7):~ > g.region rast=elevation.dem
GRASS 7.0.0svn (spearfish60_grass7):~ > r.univar elevation.dem -g
n=292317
null_cells=2661
cells=294978
min=1066
max=1840
range=774
mean=1353.66931789804
mean_of_abs=1353.66931789804
stddev=177.040679835105
variance=31343.402316476
coeff_var=13.0785766874004
sum=395700554

GRASS 7.0.0svn (spearfish60_grass7):~ > r.resamp.rst --overwrite --verbose
input=elevation.dem@PERMANENT ew_res=15 ns_res=15 elev=elev15
Processing all selected output files will require
4.50 MB of disk space for temp files.
Temporarily changing the region to desired resolution ...
Changing back to the original region ...
Percent complete:
  100%
dnorm in ressegm after grid before out2= 388.844442
dnorm in mainc after grid before out1= 388.844442
dnorm in mainc after grid before out2= 388.844442
Temporarily changing the region to desired resolution...
Changing the region back to initial...
r.resamp.rst complete.

GRASS 7.0.0svn (spearfish60_grass7):~ > r.univar elev15 -g
n=1179912
null_cells=0
cells=1179912
min=1066.04113769531
max=1840.59228515625
range=774.551147460938
mean=1353.60878808034
mean_of_abs=1353.60878808034
stddev=177.077330758482
variance=31356.3810685488
coeff_var=13.0818691720825
sum=1597139252.36145
}}}

Closing as fixed.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1718#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>