[GRASS-dev] [GRASS GIS] #2935: r.watershed returns bogus flow direction without warning when using large "virtual" terrain

#2935: r.watershed returns bogus flow direction without warning when using large
"virtual" terrain
---------------------+-------------------------
Reporter: mankoff | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Raster | Version: 6.4.4
Keywords: | CPU: Unspecified
Platform: MacOSX |
---------------------+-------------------------
I'm using the hydropotential, in units Pa, as my "elevation" for
r.watershed in order to route flow under a glacier. The values are larger
than a normal elevation, although perhaps not using grass for planetary
research. The output of "r.info" follows. When I use this with
{{{r.watershed -a --v elevation=phi accumulation=acch drainage=fdir
thresh=50 flow=RUh.2k}}}, the {{{fdir}}} results are incorrect.

If I {{{r.mapcalc 'phi = phi / 1000' # [Pa] to [kpa]}}}, then things
work.

I can provide example files if needed to recreate this.

{{{
> r.info phi
+----------------------------------------------------------------------------+
  | Layer: phi Date: Wed Feb 24 20:37:58 2016
|
  | Mapset: PERMANENT Login of Creator: mankoff
|
  | Location: Morlighem_2014
|
  | DataBase: /Users/mankoff/data/grass
|
  | Title: ( phi )
|
  | Timestamp: none
|
|----------------------------------------------------------------------------|
  |
|
  | Type of Map: raster Number of Categories: 255
|
  | Data Type: DCELL
|
  | Rows: 538
|
  | Columns: 301
|
  | Total Cells: 161938
|
  | Projection: Stereographic
|
  | N: -657600 S: -3349500 Res: 5003.53159851
|
  | E: 864700 W: -638000 Res: 4992.35880399
|
  | Range of data: min = -250782 max = 32395007.4
|
  |
|
  | Data Description:
|
  | generated by r.mapcalc
|
  |
|
  | Comments:
|
  | 1000 * 9.8 * z_b + 917 * 9.8 * (z_s - z_b)
|
  |
|
+----------------------------------------------------------------------------+
}}}

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

#2935: r.watershed returns bogus flow direction without warning when using large
"virtual" terrain
--------------------------+-------------------------
  Reporter: mankoff | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Raster | Version: 6.4.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by mankoff):

* milestone: => 7.0.4

Comment:

I've upgrade to {{{grass 7.0.3}}} and this bug still exists. Here is an
MWE to recreate it:

{{{
grass70 -text ./nc_spm_08_grass7/PERMANENT

r.rescale input=elev_srtm_30m output=HUGE_elev to=-30000,30000000
r.rescale input=elev_srtm_30m output=OK_elev to=-30,30000

r.watershed elevation=HUGE_elev accumulation=HUGE.acc drainage=HUGE.fdir
r.watershed elevation=OK_elev accumulation=OK.acc drainage=OK.fdir

g.gui.mapswipe first=HUGE.acc second=OK.acc
g.gui.mapswipe first=HUGE.fdir second=OK.fdir
}}}

Now that grass supports other planets
https://grasswiki.osgeo.org/wiki/Planetary_mapping it is likely others
will run into similar issues when flow routing over terrain with values
significantly larger than Earth topography.

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

#2935: r.watershed returns bogus flow direction without warning when using large
"virtual" terrain
--------------------------+-------------------------
  Reporter: mankoff | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Raster | Version: 7.0.3
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by mankoff):

* cc: mankoff (added)
* version: 6.4.4 => 7.0.3

Comment:

I've upgrade to {{{grass 7.0.3}}} and this bug still exists. Here is an
MWE to recreate it:

{{{
grass70 -text ./nc_spm_08_grass7/PERMANENT

r.rescale input=elev_srtm_30m output=HUGE_elev to=-30000,30000000
r.rescale input=elev_srtm_30m output=OK_elev to=-30,30000

r.watershed elevation=HUGE_elev accumulation=HUGE.acc drainage=HUGE.fdir
r.watershed elevation=OK_elev accumulation=OK.acc drainage=OK.fdir

g.gui.mapswipe first=HUGE.acc second=OK.acc
g.gui.mapswipe first=HUGE.fdir second=OK.fdir
}}}

Now that grass supports other planets
https://grasswiki.osgeo.org/wiki/Planetary_mapping it is likely others
will run into similar issues when flow routing over terrain with values
significantly larger than Earth topography.

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

#2935: r.watershed returns bogus flow direction without warning when using large
"virtual" terrain
--------------------------+-------------------------
  Reporter: mankoff | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Raster | Version: 7.2.0
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by mankoff):

* version: 7.0.3 => 7.2.0
* milestone: 7.0.6 => 7.2.1

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

#2935: r.watershed returns bogus flow direction without warning when using large
"virtual" terrain
--------------------------+-------------------------
  Reporter: mankoff | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: Raster | Version: 7.2.0
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by mankoff):

* milestone: 7.2.4 => 7.8.0

Comment:

Updating milestone so that this is included in !GitHub migration.

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