## DESCRIPTION

v.clean allows the user to automatically fix topology of vector files.

## NOTES

The user does not have to run v.build on the output vector, unless the -b flag was used. The -b flag affects only the output vector - topology is always built for error vector.

### Removing small angles between lines at nodes

The rmsa tool only concerns angles which are so small that the calculated angle is 0. The user cannot change this threshold. The following figure should help to understand what the tool does.

### What is a bridge?

A bridge is an area type connection of an island (polygon in a polygon) to the outer polygon. This is topologically incorrect (but OGC Simple Features allow it). v.clean can be used to optionally change the line type to fulfill the topology rules or to remove the bridge from the map:

        +-------------+             +-------------+   +-------------+
        |            P|  P: polygon |            P|   |            P|
        |    +---+    |  I: island  |    +---+    |   |    +---+    |
        |    | I |    |  B: bridge  |    | I |    |   |    | I |    |
        |    |   |    |  L: line    |    |   |    |   |    |   |    |
        |    +-+-+    |             |    +---+    |   |    +-.-+    |
        |      |      |             |             |   |      .      |
        |      | B    |             |             |   |      . L    |
        |      |      |             |             |   |      .      |
        +------+------+             +-------------+   +-------------+

## EXAMPLES

### Snap lines to vertex in threshold

    v.clean input=testmap output=cleanmap tool=snap thresh=1

### Cleaning OGR imported data (Simple Feature data)

The import of areas with v.in.ogr requires a subsequent run of v.clean to update the map to a topologically valid structure (removal of duplicate collinear lines etc). The tools used for that are 'rmdupl' and 'bpol':

    v.clean input=areamap output=areamap_clean tool=rmdupl,bpol

### Extracting intersection points of vector lines

    v.clean input=lines1 output=lines2 err=points tool=break

Intersection points are written to 'points' map.

### Break lines

v.clean will break the lines where they cross, creating new node if needed. Example:

    v.in.ascii -n out=crossed_lines format=standard << EOF
    L 2
     0 5
     10 5
    L 2
     5 0
     5 10
    EOF

    v.clean in=crossed_lines out=crossed_lines_brk \
            error=intersection tool=break

## AUTHORS

David Gerdes, U.S. Army Construction Engineering Research Laboratory
Radim Blazek, ITC-Irst, Trento, Italy

Last changed: $Date: 2006/09/29 21:22:55 $