Dear Grass users and developers,<br><br>The observation highlighted in blue reminded me to post this question on the list.<br><br>
<i style="color:rgb(0,153,0)">" Subject: Re: [GRASS-user] How to find the second largest value in a series of rasters.<br>
Sylvain Maillard wrote:<br><br>
The problem can be solved by running "r.series method=max_raster",
</i><i style="color:rgb(0,153,0)"><br>
then filtering each input map, setting a cell to null if the input<br>
map has the largest value for that particular cell, then running<br>
"r.series method=max" on the filtered maps.<br><br>
<span style="background-color:rgb(255,255,255);color:rgb(51,0,153)">But that's very inefficient compared to implementing a</span><span style="color:rgb(51,0,153)">
</span></i><i style="color:rgb(51,0,153)"><br style="background-color:rgb(255,255,255)"><span style="background-color:rgb(255,255,255)">
"second-largest" aggregate directly.</span>" </i><br style="color:rgb(51,0,153)"><br>This question is in my mind as I am trying to work on scale of sub-basin
(300 sq km) with a 90m SRTM DEM on a region having 42000*42000 rows by
columns.<br>The addon module r.stream.basins (using arrays) for GRASS7 is really a master-stroke.It reports basin area for each individual category in one map.<br>But getting cumulative basin area on each point becomes so hardware intensive and time intensive that it's beyond any practical use. <br>
Please note that I have 2tb harddisk and 16gb ram with six processor. Maximum that I could arrange.<br>For one tenth of the area mentioned above, computer ran for one week uninterrupted to generate the raster.<br>Process:<br>
i. r.stream.basin for each point ,<br>ii. then r.stat for area,<br>iii. then db.select for updating the database of vector (vector of basins generated from r.to.vect type=area, then cleaning for zero area)<br>The vector table generated thus requires intervention and visual comparison also.<br>
<br>After that, approximately 90gb space was consumed. As a rough estimate, whole exercise might have taken months and all my hard disk space.<br><br>If, we can add two values to a raster (value1, value2) ( individual basin area, cumulative basin area), the work would have finished in twenty minutes instead of one week.<br>
(Note: This is my assumption only based on the performance of r.stream.basins grass7 version for individual basin area.)<br><br>Really, the r.stream.basins (Grass 7 version) is amazing. <br><br>Meanwhile , I have assembled a way to find this area using vectors only. Which is described below:<br>
The basin area results obtained from r.stream.basins have to be converted to vector. <br>Then, it should be cleaned to maintain conformity with the raster.<br>Then, using v.net.allpairs ( Its a really great module. Great piece of work.Thanks to developers. Thanks to Dear Daniel Bundala) , individual area lying above a point can be added and cumulative area can be uploaded to database.<br>
<br>It still takes time, but I can finish the work within given time and available hardware.<br><br>By the way, I have troubles with v.label module. I want to show both the individual basin area and cumulative basin area on the map. <br>
But, it's not working. (No <> map error.)<br>Help please.<br>
<br style="background-color:rgb(51,51,255);color:rgb(51,102,255)">
<br>
<br>