[GRASS-user] Criteria for v.clean tool=rmdangle

Markus GRASS markus.metz.giswork at googlemail.com
Tue Jun 16 03:41:22 EDT 2009

Dwight Needels wrote:
> When the rmdangle tool runs into a pair of dangles at the end of a
> line where each is shorter than threshold (a "Y"), it removes one but
> leaves the other. This makes sense, because after the first one is
> removed the second one is no longer a dangle (it is now the terminal
> line segment).
"Line segment" is confusing because it refers to a part of a line, e.g.
a part of line C or A. Line E may have only one segment, line C is
composed of several segments.
> The question is, how does it decide which one to remove ? 
First come fist serve. The rmdangle tool doesn't really decide, it goes
through all lines and if a line is a dangle and shorter than threshold,
it gets removed. The tool does not look at a pair of dangles at once as
far as I can tell.
> I expected rmdangle to remove the shorter of the two choices in each
> instance. In my example, lines A, B, D & E are all shorter than the 30
> ft threshold, and A, D & E are dangles. Removing the shorter dangle at
> each decision point would leave the longest below-threshold segments
> (A & B) while removing the two shorter ones (D & E). Instead, rmdangle
> leaves only the shortest segment (E) while removing the three longest
> ones (A, B & D), including one that isn't a dangle in the original
> vector.
Looks like A and D were removed first, then B qualified as a dangle and
was also removed, but why line E stayed in place is strange, it should
also be removed with that threshold.
> How does v.clean tool=rmdangle decide which dangle to remove when
> there is a choice between two dangles shorter than the threshold?
I think first come first serve, no decision or comparison between two
dangles happens. I may have to go to the source code again to make sure...

Markus M

More information about the grass-user mailing list