[GRASS-dev] Doubt regarding r.lake
Jyothish Soman
jyothish.soman at gmail.com
Mon Jun 15 15:15:34 EDT 2009
I went through the code of r.lake, and found a few relevant things that
might speed things up. I am hoping to get some brickbats and suggestions on
this one.
Basic idea is to map the map as a binary image of 0 and 1
Do a connected component labelling of the image
Must be faster than regular O(n3) method that is given in the code.
The basic Idea I have is of using the temporary map to keep as a union find
datastructure,
References
http://en.wikipedia.org/wiki/Connected_Component_Labeling#Two-pass
page 12 to 14 of
http://www.cse.msu.edu/~stockman/Book/2002/Chapters/ch3.pdf<http://www.cse.msu.edu/%7Estockman/Book/2002/Chapters/ch3.pdf>
If anybody is intrested, I can give a more detailed description....
:)
--
JYOTHISH SOMAN
MS-2008-CS
Center for Security, Theory And Algorithm Research (CSTAR)
International Institute of Information Technology
Hyderabad
India
Phone:+91-9966222626
http://www.iiit.ac.in/
--------------------------------------------------------------
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore, all progress
depends on the unreasonable man.
George Bernard Shaw
--------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20090616/81498ce7/attachment.html
More information about the grass-dev
mailing list