[GRASS-user] Hydrological grass question: main channel length for each subbasin
tea3rd at gmail.com
Mon Feb 17 11:20:07 PST 2014
If it were me, I'd go ahead and take the hit with the brute force method.
However, I was involved with a project in calculating basin average
precipitation in real-time, over many basins (~700) for many time periods,
several times per day. Each second was critical; what we did was to convert
the real values to ints as cat values and associate them to basin IDs; then
convert back to reals -- this was very fast (I can provide shell
scripting). I understand this is not want you want, but you may be able to
do something analogously, by converting the stream main channel pixels to
the same cat value and count them (as they are associated with each basin),
then multiply by the pixel resolution -- if you follow what I'm
suggesting... Doing what we did, did not involve any looping -- which would
have been disasterously slow for our application.
On Monday, February 17, 2014, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> On Mon, 17 Feb 2014, Michel Wortmann wrote:
> this is what I meant by looping over each subbasin, but that is exactly
>> what I would like to avoid as it would take a lot of time for 1000+
>> subbasins and I dont really need all the other analysis.
> If you look at the code for that module you'll see that you cannot get
> directly to the end without calculating all the intermediate values; one
> attribute builds on those calculated before it. As long as the
> are being calculated there's no reason to not put their results in the
> overall table.
> If you want only main channel length for 1000+ subbasins you might figure
> out a way to calculate that directly and modify the code (with a different
> module name, of course) to do that. This is one of the advantages of open
> source software licensed under the GPL.
> Richard B. Shepard, Ph.D. | Have knowledge, will travel.
> Applied Ecosystem Services, Inc. |
> <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax:
> grass-user mailing list
> grass-user at lists.osgeo.org
Thomas E Adams, III
718 McBurney Drive
Lebanon, OH 45036
1 (513) 739-9512 (cell)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user