# [GRASS-dev] Re: [GRASS-user] v.clean tool=prune - 'thresh' interpreted wrong?

Moritz Lennert mlennert at club.worldonline.be
Tue Oct 3 08:23:56 EDT 2006

```Maciej Sieczka wrote:
> Hamish wrote:
>> Maciej Sieczka wrote:
>
>>> 	\$ echo "L 4 1
>>> 	 10 10
>>> 	 20 10
>>> 	 30 10
>>> 	 40 10
>>> 	 1     1" | v.in.ascii -n out=line format=standard
>>>
>>>
>>> So there are 4 vertices and the distance between each 2 following is
>>> 10. Then I don't understand why the:
>>>
>>> 	\$ v.clean input=line output=line_pruned type=line tool=prune
>>> 	thresh=1
>
>>> I declared thresh=1, the distance between vertices is 10 - so none
>>> should be removed, but all are! And the same happens with all the lower
>>> thresholds until thresh=0.03.
>
>> what if there is some angle between the points? e.g.
>>
>> v.in.ascii -n out=line format=standard << EOF
>> L 4 1
>>  10 10
>>  20 5
>>  30 7.5
>>  40 10
>>  1  1
>> EOF
>
> \$ v.clean input=line output=line2_pruned type=line tool=prune thresh=1
>
> \$ v.out.ascii line2_pruned format=standard | awk 'NR>10'
> L  3 1
>  10           10
>  20           5
>  40           10
>  1     1
>
> The thresh=1, but v.clean prunes the 3rd vertex "30 7.5", which as far
> from the other 2 vertices as ~10.3! I don't get it.

Doesn't

20 5
30 7.5
40 10

Define a straight line ? I would guess that the prune tool prunes all
"unneccessary" nodes on a straight line, i.e. any node which is not
necessary to define the line, and this whatever the threshold.

The threshold only applies in cases of change of direction (i.e. angles).

Just another example of the need for much more documentation for
v.clean, including example diagrams like the one for the rmsa tool.

Moritz

```