[GRASS-dev] [GRASS GIS] #3695: r.terraflow should support large file dimensions by default

GRASS GIS trac at osgeo.org
Sun Nov 18 06:06:58 PST 2018


#3695: r.terraflow should support large file dimensions by default
--------------------------+-------------------------
  Reporter:  mankoff      |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:
 Component:  Raster       |    Version:  svn-trunk
Resolution:               |   Keywords:  r.terraflow
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by mmetz):

 Replying to [ticket:3695 mankoff]:
 > Currently {{{r.terraflow}}} is limited to rasters with width or height <
 SHRT_MAX (32678). I imagine this default made sense years ago when this
 was coded, but now on even a decent laptop {{{r.watershed}}} works with
 rasters that large.

 Makes sense. Note that the concept of `r.terraflow` is to avoid seek'ing
 on slow spinning harddrives. With SSD's, there is no measurable speed
 penalty when seek'ing, and `r.terraflow` looses this advantage over e.g.
 `r.watershed`.

 > I suggest {{{r.terraflow}}} remove this limit so that users with large
 rasters do not need to recompile it. Patch attached and inline below:
 >
 > {{{
 > Index: raster/r.terraflow/types.h
 > ===================================================================
 > --- raster/r.terraflow/types.h        (revision 73638)
 > +++ raster/r.terraflow/types.h        (working copy)
 > @@ -26,8 +26,8 @@
 >  /* input parameters type */
 >  /* ------------------------------------------------------------ */
 >
 > -typedef short dimension_type; /* represent dimension of the grid */
 > -static const dimension_type dimension_type_max=SHRT_MAX;
 > +typedef long dimension_type; /* represent dimension of the grid */
 > +static const dimension_type dimension_type_max=LONG_MAX;
 >
 >  typedef short direction_type;  /* represent the direction of a cell */
 >  static const direction_type DIRECTION_UNDEF=-1;
 > }}}

 GRASS uses `int` as type for rows and columns which should be more than
 sufficient. `long`, if it is a 64 bit integer, is too much, and `long` is
 sometimes 32 bit, sometimes 64 bit, therefore I suggest to change `short`
 to `int`.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3695#comment:3>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list