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

Dwight Needels needels at translucida.com
Mon Jun 15 16:19:09 EDT 2009


On Jun 15, 2009, at 2:25 AM, Markus GRASS wrote:
> Then there was nothing snapped? You can see what happened with v.clean
> --verbose. Just to make sure I understand you correctly, have a look  
> at
> the attached image. I guess you want to remove the line segments
> indicated by the arrows? Then the two lines need to be broken where  
> the
> red crosses are, and in order to break there with tool=break, snapping
> may be needed first, at least for the left cross.

Correct; nothing was snapped or broken with v.clean tool=snap,break,  
and the error map was empty. Also correct that I expected (and wanted)  
the segments indicated by the arrows in your screenshot to be removed  
(D & E in my new screenshot).

My previous screenshots showed a tiny piece of a vector that I had  
processed to remove the jaggies before running v.clean. I repeated  
everything with a smaller portion of the vector for simplicity, and  
without the processing step to make sure it wasn't causing the problem  
(it wasn't). The first attached screenshot (v.clean_quirk) shows the  
overall issue. The green and yellow line is the raster generated by  
r.thin (res = 1 ft), the gray line is the vector created by r.to.vect,  
and the red line is the vector after cleaning with v.clean  
tool=snap,break,rmdangle threshold=0.9,0,30.

The original vector has 6 nodes, 73 vertices, and 5 lines, with  
lengths as shown in the screenshot (most of line C is beyond the right  
edge of the screenshot). These counts do not change after cleaning  
with snap, break or after running v.build.polylines.

The second screenshot (v.clean_v.digit) shows the original vector  
(before v.clean) in v.digit, which is also identical to the way it  
looks after v.clean tool=snap, break as well as after v.build.polylines.

> A line is a dangle if at least one of its two nodes is not connected  
> to
> another line (dead end). A dangle is removed if it is smaller than
> threshold, if threshold is < 0, all dangles are removed. I want to
> update the v.clean manual when I get the time...


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).

The question is, how does it decide which one to remove ? 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.

How does v.clean tool=rmdangle decide which dangle to remove when  
there is a choice between two dangles shorter than the threshold?

Thanks, -Dwight
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.clean_quirk.png
Type: image/png
Size: 15657 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20090615/c2092936/v.clean_quirk-0001.png
-------------- next part --------------
  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.clean_v.digit.png
Type: image/png
Size: 4937 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20090615/c2092936/v.clean_v.digit-0001.png


More information about the grass-user mailing list