[GRASS-dev] [GRASS GIS] #2917: r.mapcalc neighbour modifier uses wrong row

GRASS GIS trac at osgeo.org
Tue Mar 1 05:53:41 PST 2016


#2917: r.mapcalc neighbour modifier uses wrong row
--------------------------+---------------------------------
  Reporter:  marisn       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  blocker      |  Milestone:  7.0.4
 Component:  Raster       |    Version:  svn-releasebranch70
Resolution:               |   Keywords:  r.mapcalc
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+---------------------------------

Comment (by glynn):

 Replying to [comment:6 marisn]:

 > If I understood correctly, the issue was triggered by any mapcalc
 expression containing two to eight references to same map (MAP[n,x] and
 MAP[m,x], ...) where n!=m.

 The row cache is contiguous, but limited to 8 rows. So it's used if the
 range of offsets (maximum row offset minus the minimum row offset plus
 one) is between 2 and 8 inclusive.

 So if an expression contained e.g. map[-10] and map[10], the cache
 wouldn't be used (because it would need to hold 21 rows, which is more
 than the maximum of 8 rows). In that case, each row would be read multiple
 times rather than being cached.

 Any expression using two or more distinct row offsets for a map (no offset
 is equivalent to an offset of zero) "might" trigger it. Scripts which use
 fixed offsets typically use small offsets, so the range being less than or
 equal to 8 is likely. Scripts which use larger row offsets typically do so
 by way of using variable row offsets, so it's likely that the cache will
 be used "sometimes".

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



More information about the grass-dev mailing list