[GRASS-git] [OSGeo/grass-addons] d21bb7: r.stream: Fix segment calculation forcing swap mod...

Bhuvan Somisetty noreply at github.com
Tue Sep 15 13:38:50 PDT 2026


  Branch: refs/heads/grass8
  Home:   https://github.com/OSGeo/grass-addons
  Commit: d21bb79684b048bdaf43397eba47a2f61957e05d
      https://github.com/OSGeo/grass-addons/commit/d21bb79684b048bdaf43397eba47a2f61957e05d
  Author: Bhuvan Somisetty <somisettybhuvan5 at gmail.com>
  Date:   2026-09-15 (Tue, 15 Sep 2026)

  Changed paths:
    M src/raster/r.stream.basins/main.c
    M src/raster/r.stream.channel/main.c
    M src/raster/r.stream.distance/main.c
    M src/raster/r.stream.order/main.c
    M src/raster/r.stream.segment/main.c
    M src/raster/r.stream.stats/main.c

  Log Message:
  -----------
  r.stream: Fix segment calculation forcing swap mode (#1838)

In r.stream.basins, r.stream.channel, r.stream.distance, r.stream.order,
r.stream.segment, and r.stream.stats, the calculation of
number_of_segs_total incorrectly added the remainder (nrows % SROWS)
rather than 1 for partial segments.

When nrows or ncols were not exact multiples of 128 (SROWS/SCOLS), this
inflated the segment count estimate, causing modules to falsely conclude
that the raster exceeded the memory limit and forcing disk-swapping
mode even for small maps fitting entirely in RAM.

Fix the formula to use standard ceiling division across all 6 tools.

Fixes #1837

Signed-off-by: bhuvan-somisetty <somisettybhuvan5 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass-addons/settings/notifications


More information about the grass-commit mailing list