[GRASS-dev] v.clean tool=rmline thresh= ?

Hi,

any reason why 'v.clean tool=rmline' doesn't respect thresh= to remove small lines? (like rmarea) Or is it just a matter of writing the code?
  http://trac.osgeo.org/grass/changeset/24404

workaround:
v.db.addcol column='DOUBLE length'
v.to.db option=length column=length
v.extract where='length > $thresh'

thanks,
Hamish

Hi,

2008/2/5, Hamish <hamish_b@yahoo.com>:

any reason why 'v.clean tool=rmline' doesn't respect thresh= to remove small lines? (like rmarea) Or is it just a matter of writing the code?
  http://trac.osgeo.org/grass/changeset/24404

rmline should remove only collapsed lines/boundaries (zero-length). To
clean map geometry.

workaround:
v.db.addcol column='DOUBLE length'
v.to.db option=length column=length
v.extract where='length > $thresh'

or better

to remove all lines/boundaries shorter than $thresh

v.edit a1 tool=delete query=length type=line,boundary thresh=-$thresh

longer than $thresh

v.edit a1 tool=delete query=length type=line,boundary thresh=-$thresh

It would be possible to modify rmline tool in v.clean to be
thresh-sensitive. Since v.edit do the job in the better way I think we
can leave rmline as it is.

Regards, Martin

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hamish:

> any reason why 'v.clean tool=rmline' doesn't respect thresh= to
> remove small lines? (like rmarea) Or is it just a matter of writing
> the code?
> http://trac.osgeo.org/grass/changeset/24404

Martin:

rmline should remove only collapsed lines/boundaries (zero-length).
To clean map geometry.

> workaround:
> v.db.addcol column='DOUBLE length'
> v.to.db option=length column=length
> v.extract where='length > $thresh'

or better

to remove all lines/boundaries shorter than $thresh
v.edit a1 tool=delete query=length type=line,boundary thresh=-$thresh

Excellent. Thanks.

longer than $thresh
v.edit a1 tool=delete query=length type=line,boundary thresh=-$thresh

(did you mean "thresh=$thresh" or "thresh=+$thresh" ?)

It would be possible to modify rmline tool in v.clean to be
thresh-sensitive. Since v.edit do the job in the better way I think
we can leave rmline as it is.

ok, but it's a bit inconsistent.

Hamish

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

Hi,

2008/2/6, Hamish <hamish_b@yahoo.com>:

> to remove all lines/boundaries shorter than $thresh
> v.edit a1 tool=delete query=length type=line,boundary thresh=-$thresh

Excellent. Thanks.

> longer than $thresh
> v.edit a1 tool=delete query=length type=line,boundary thresh=-$thresh

(did you mean "thresh=$thresh" or "thresh=+$thresh" ?)

sorry, typo, I meant thresh=$thresh (or thresh=+$thresh)

> It would be possible to modify rmline tool in v.clean to be
> thresh-sensitive. Since v.edit do the job in the better way I think
> we can leave rmline as it is.

ok, but it's a bit inconsistent.

to rename rmline, to rmzeroline ?

Martin

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Martin wrote:

> > to remove all lines/boundaries shorter than $thresh
> > v.edit a1 tool=delete query=length type=line,boundary
> > thresh=-$thresh

Hamish:

> Excellent. Thanks.
>
> > longer than $thresh
> > v.edit a1 tool=delete query=length type=line,boundary
> > thresh=-$thresh
>
> (did you mean "thresh=$thresh" or "thresh=+$thresh" ?)

sorry, typo, I meant thresh=$thresh (or thresh=+$thresh)

M:

> > It would be possible to modify rmline tool in v.clean to be
> > thresh-sensitive. Since v.edit do the job in the better way I
> > think we can leave rmline as it is.

H:

> ok, but it's a bit inconsistent.

M:

to rename rmline, to rmzeroline ?

I thought it might be nice to eventually add thresh support to
v.clean's rmline, even if it is a redundant method. tool=rmline is
redundant too (v.edit thresh=0.0), so it's no worse... I hesitate to
even suggest this, but even as an embedded system("v.edit query=length
thresh=%f", ...). Well probably a bad thing to do that but I don't
think reimplementing it is enough lines of code to worry about the
evils of code duplication or moving it to a common lib fn.

Hamish

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs