[GRASS-user] Duplicate vector removal

Good day,

I used the v.clean approach to snap some vectors to each other. This caused a number of vectors to lie on the same line. The rmdupl option does not seem to remove these short segments.

Any ideas on how I can get rid of them? Or perhaps I’m just using v.clean wrong. Here is the command:

v.clean input=scene01@test output=scene01_clean type=line tool=snap,rmdupl,rmsa thresh=15 --overwrite

Thanks!


Groete,
Andre Hauptfleisch

M: 082 5722 469
F: 086 687 1106
E: ahaupt@gmail.com

Hi,

2007/11/20, Andre Hauptfleisch <ahaupt@gmail.com>:

Good day,

I used the v.clean approach to snap some vectors to each other. This caused
a number of vectors to lie on the same line. The rmdupl option does not seem
to remove these short segments.

Any ideas on how I can get rid of them? Or perhaps I'm just using v.clean
wrong. Here is the command:

v.clean input=scene01@test output=scene01_clean type=line
tool=snap,rmdupl,rmsa thresh=15 --overwrite

rmdupl removes only *identical* features, for example

L 2 1
594233.1875 4921026.59375
596956.11875847 4921515.74307787
1 1
L 2 1
596956.11875847 4921515.74307787
599775.5 4922022.21875
1 2
L 2 1
594233.1875 4921026.59375
599775.5 4922022.21875
1 3
L 2 1
595793 4918172.46875
603426.125 4919400.40625
1 4
L 2 1
595793 4918172.46875
603426.125 4919400.40625
1 5

after rmdupl

L 2 1
594233.1875 4921026.59375
596956.11875847 4921515.74307787
1 1
L 2 1
596956.11875847 4921515.74307787
599775.5 4922022.21875
1 2
L 2 1
594233.1875 4921026.59375
599775.5 4922022.21875
1 3
L 2 2
595793 4918172.46875
603426.125 4919400.40625
1 5
1 4

First two lines 'lie' on the third one, but they are not identical, if
you want to remove them, you need to merge them first. E.g.

v.edit dupl1 tool=merge cat=1,2

remove vertex from line

v.generalize in=dupl1 out=dupl2

and then run v.clean.

The result is

L 2 3
594233.1875 4921026.59375
599775.5 4922022.21875
1 1
1 2
1 3
L 2 2
595793 4918172.46875
603426.125 4919400.40625
1 5
1 4

Martin

Thanks!

--
Groete,
Andre Hauptfleisch

M: 082 5722 469
F: 086 687 1106
E: ahaupt@gmail.com
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

Thanks for the reply Martin. I thought it might have something to do with the category values.

I know it is easier said than done, but isn’t there a way one can skip the category merger part? Or can I merge all the lines into a single category? My system doesn’t require the use of category values.

I would like to automate the process. At the moment I have a raster image with some lines in them. I convert these to a vector layer, clean it up a bit and output it to svg.

Regards,
Andre

On Nov 20, 2007 2:03 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2007/11/20, Andre Hauptfleisch <ahaupt@gmail.com>:

Good day,

I used the v.clean approach to snap some vectors to each other. This caused
a number of vectors to lie on the same line. The rmdupl option does not seem
to remove these short segments.

Any ideas on how I can get rid of them? Or perhaps I’m just using v.clean
wrong. Here is the command:

v.clean input=scene01@test output=scene01_clean type=line
tool=snap,rmdupl,rmsa thresh=15 --overwrite

rmdupl removes only identical features, for example

L 2 1
594233.1875 4921026.59375
596956.11875847 4921515.74307787
1 1
L 2 1
596956.11875847 4921515.74307787
599775.5 4922022.21875
1 2
L 2 1
594233.1875 4921026.59375
599775.5 4922022.21875
1 3
L 2 1
595793 4918172.46875
603426.125 4919400.40625
1 4
L 2 1
595793 4918172.46875
603426.125 4919400.40625
1 5

after rmdupl

L 2 1
594233.1875 4921026.59375
596956.11875847 4921515.74307787
1 1
L 2 1
596956.11875847 4921515.74307787
599775.5 4922022.21875
1 2
L 2 1
594233.1875 4921026.59375
599775.5 4922022.21875
1 3
L 2 2
595793 4918172.46875
603426.125 4919400.40625
1 5
1 4

First two lines ‘lie’ on the third one, but they are not identical, if
you want to remove them, you need to merge them first. E.g.

v.edit dupl1 tool=merge cat=1,2

remove vertex from line

v.generalize in=dupl1 out=dupl2

and then run v.clean.

The result is

L 2 3
594233.1875 4921026.59375
599775.5 4922022.21875
1 1
1 2
1 3
L 2 2
595793 4918172.46875
603426.125 4919400.40625
1 5
1 4

Martin

Thanks!


Groete,
Andre Hauptfleisch

M: 082 5722 469
F: 086 687 1106
E: ahaupt@gmail.com


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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


Groete,
Andre Hauptfleisch

M: 082 5722 469
F: 086 687 1106
E: ahaupt@gmail.com

Hi Andre,

2007/11/20, Andre Hauptfleisch <ahaupt@gmail.com>:

Thanks for the reply Martin. I thought it might have something to do with
the category values.

I know it is easier said than done, but isn't there a way one can skip the
category merger part? Or can I merge all the lines into a single category?
My system doesn't require the use of category values.

I would like to automate the process. At the moment I have a raster image
with some lines in them. I convert these to a vector layer, clean it up a
bit and output it to svg.

not sure if I understand well, you can remove categories after
cleaning vector map layer

v.category opt=delete

?

Martin

Regards,
Andre

On Nov 20, 2007 2:03 PM, Martin Landa <landa.martin@gmail.com> wrote:
> Hi,
>
> 2007/11/20, Andre Hauptfleisch <ahaupt@gmail.com>:
>
> > Good day,
> >
> > I used the v.clean approach to snap some vectors to each other. This
caused
> > a number of vectors to lie on the same line. The rmdupl option does not
seem
> > to remove these short segments.
> >
> > Any ideas on how I can get rid of them? Or perhaps I'm just using
v.clean
> > wrong. Here is the command:
> >
> > v.clean input=scene01@test output=scene01_clean type=line
> > tool=snap,rmdupl,rmsa thresh=15 --overwrite
>
> rmdupl removes only *identical* features, for example
>
> L 2 1
> 594233.1875 4921026.59375
> 596956.11875847 4921515.74307787
> 1 1
> L 2 1
> 596956.11875847 4921515.74307787
> 599775.5 4922022.21875
> 1 2
> L 2 1
> 594233.1875 4921026.59375
> 599775.5 4922022.21875
> 1 3
> L 2 1
> 595793 4918172.46875
> 603426.125 4919400.40625
> 1 4
> L 2 1
> 595793 4918172.46875
> 603426.125 4919400.40625
> 1 5
>
> after rmdupl
>
> L 2 1
> 594233.1875 4921026.59375
> 596956.11875847 4921515.74307787
> 1 1
> L 2 1
> 596956.11875847 4921515.74307787
> 599775.5 4922022.21875
> 1 2
> L 2 1
> 594233.1875 4921026.59375
> 599775.5 4922022.21875
> 1 3
> L 2 2
> 595793 4918172.46875
> 603426.125 4919400.40625
> 1 5
> 1 4
>
> First two lines 'lie' on the third one, but they are not identical, if
> you want to remove them, you need to merge them first. E.g.
>
> v.edit dupl1 tool=merge cat=1,2
>
> remove vertex from line
>
> v.generalize in=dupl1 out=dupl2
>
> and then run v.clean.
>
> The result is
>
> L 2 3
> 594233.1875 4921026.59375
> 599775.5 4922022.21875
> 1 1
> 1 2
> 1 3
> L 2 2
> 595793 4918172.46875
> 603426.125 4919400.40625
> 1 5
> 1 4
>
> Martin
>
>
> > Thanks!
> >
> > --
> > Groete,
> > Andre Hauptfleisch
> >
> > M: 082 5722 469
> > F: 086 687 1106
> > E: ahaupt@gmail.com
> > _______________________________________________
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
> >
> >
>
>
> --
> Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *
>

--

Groete,
Andre Hauptfleisch

M: 082 5722 469
F: 086 687 1106
E: ahaupt@gmail.com

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