Opened 11 years ago
Last modified 5 years ago
#2296 new enhancement
r.stream.* - unify some functions (avoid code duplication)
Reported by: | hellik | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.3 |
Component: | Addons | Version: | svn-trunk |
Keywords: | r.stream.* | Cc: | |
CPU: | All | Platform: | All |
Description
the r.stream.*-modules were recently added to trunk.
to avoid code duplication, some functions should be unified over these modules in a lib(?) because following files are the same over all r.stream.*-modules:
http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.channel/io.c http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.distance/io.c http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.order/io.c http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.segment/io.c http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.snap/io.c http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.stats/io.c http://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.stream.basins/io.c
http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.channel/io.h http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.distance/io.h http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.order/io.h http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.segment/io.h http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.snap/io.h http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.stats/io.h http://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.stream.basins/io.h
Change History (23)
follow-up: 2 comment:1 by , 11 years ago
follow-up: 3 comment:2 by , 11 years ago
Replying to glynn:
Replying to hellik:
to avoid code duplication, some functions should be unified over these modules in a lib(?)
While we're at it, maybe we should look into unifying all of the different "segment" libraries.
They all do essentially the same thing: provide a 2-dimensional array which may be too large to fit into RAM (or, more accurately, into the process' address space; if RAM was the issue, mmap() etc would suffice), and which can be accessed (more or less) randomly.
Apart from the "official" segment library (lib/segment), r.proj has its own, r.stream.* each have their own, r.grow.distance has something simpler (the temporary file is read row-by-row but in reverse).
http://trac.osgeo.org/grass/browser/grass/trunk/lib/segment http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.grow.distance http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.proj http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.stream.extract
unifying all of the different "segment" libraries may be a good choice.
worth to open a new ticket?
comment:3 by , 11 years ago
comment:4 by , 11 years ago
Milestone: | 7.0.0 → 7.1.0 |
---|
comment:5 by , 10 years ago
Milestone: | 7.1.0 → 7.0.0 |
---|
Replying to hellik:
the r.stream.*-modules were recently added to trunk.
to avoid code duplication, some functions should be unified over these modules in a lib(?) because following files are the same over all r.stream.*-modules
The io.c and files I had sync'ed in r60127. Not sure if it is worth to move them into an own library.
comment:6 by , 10 years ago
Component: | Raster → Addons |
---|
TODO for all r.stream.* modules (reported by mmetz in grass-dev):
Most importantly it is the NULL handling that needs to be fixed, and synced between the ram and disk modes. More generally, the ram and disk modes need to be synced and validated. For ease of maintenance, the ram mode could be removed.
comment:7 by , 10 years ago
Milestone: | 7.0.0 → 7.0.1 |
---|
comment:14 by , 9 years ago
Milestone: | 7.0.4 → 7.0.5 |
---|
comment:15 by , 8 years ago
Milestone: | 7.0.5 → 7.3.0 |
---|---|
Priority: | major → normal |
The modules are back in addons. Downgrading priority and changing milestone.
comment:18 by , 6 years ago
Milestone: | 7.4.1 → 7.4.2 |
---|
comment:19 by , 6 years ago
Milestone: | 7.4.2 → 7.6.0 |
---|
All enhancement tickets should be assigned to 7.6 milestone.
comment:23 by , 5 years ago
Milestone: | → 7.8.3 |
---|
Replying to hellik:
While we're at it, maybe we should look into unifying all of the different "segment" libraries.
They all do essentially the same thing: provide a 2-dimensional array which may be too large to fit into RAM (or, more accurately, into the process' address space; if RAM was the issue, mmap() etc would suffice), and which can be accessed (more or less) randomly.
Apart from the "official" segment library (lib/segment), r.proj has its own, r.stream.* each have their own, r.grow.distance has something simpler (the temporary file is read row-by-row but in reverse).