[GRASS-user] v.dissolve for lines?

Markus Metz markus.metz.giswork at googlemail.com
Wed Oct 20 02:36:54 EDT 2010


Micha Silver wrote:
> Bryan Keith wrote:
>>
>> Hello,
>>
>> I have a vector line file that has lots of two-vertex lines.  Many of
>> these two-vertex lines share endpoints and really just make parts of one
>> longer line.  I'd like to dissolve these lines into one line when they
>> have the same end point.  It looks like v.dissolve only works for areas.
>> Is there somewhere else I should be looking?  Thank you.
>>
>>
>
> Did you have a look at v.build.polylines ?
> Additional note: line vectors have a direction. Two line segments with an
> equivalent node (end point) will *not* connect if they are in opposite
> directions.

Each line has two nodes, one at the start and one at the end. If at
the end of one line any other line is starting or ending, this other
line is added to the first line, reversing the direction if necessary.
IOW, two lines with a common node will indeed connect, and the
direction of one line may need to be reversed (done automatically).
Very simple to test by digitizing a simple test vector.

In this case you can try the v.edit tool=flip option (on those
> segments only)

Should not be needed as pre-processing step for v.build.polylines.


Markus M


More information about the grass-user mailing list