h2gis icon indicating copy to clipboard operation
h2gis copied to clipboard

Hydrological functions optimization

Open ebocher opened this issue 9 years ago • 2 comments

The idea is to find a better way to improve the flow accumulation and watershed functions that are slow.

ebocher avatar Nov 30 '15 14:11 ebocher

For the performance issue. We should not compute and store weight pixels that are equal 0. Here the number of non-zero pixel over weight propagation loop:

stats_d8flowaccum

If we manage to do that, the computation time of step will be equal to the graphic decrease.

The JAI functions will stay the same. However the main functions ST_D8FlowAccumulation/ST_D8Watershed will use a tiling approach in order to compute and store only the necessary pixels.

The size of the ROI will be the same of the number of tiles in each direction.

After each computation the rectangle list(merge of neighbouring tiles) of ROI will be evaluated to find tiles that have been modified and store them. The next iteration will be done on modified tiles in the last iteration with a buffer of 1 tile.

The ROIShape class and the TiledImage of JAI will be helpful for this task. Stored tiles will be done in a single temporary table, or stored in temporary folder with an image driver.

nicolas-f avatar Nov 30 '15 14:11 nicolas-f

The flow accumulation and watershed functions are too slow to be used in a real environment. 45 minutes to compute the flow accumulation on a small DEM (ncols 1515, nrows 1120). We must find a better strategy.

ebocher avatar Feb 05 '16 11:02 ebocher