v.clean

Langue: en

Autres versions - même langue

Version: 370884 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)

NAME

v.clean - Toolset for cleaning topology of vector map.

KEYWORDS

vector, topology

SYNOPSIS

v.clean
v.clean help
v.clean [-b] input=name output=name [type=string[,string,...]] [error=name] tool=string[,string,...] [thresh=float[,float,...]] [--overwrite] [--verbose] [--quiet]

Flags:

-b

Don't build topology for the output vector
--overwrite

Allow output files to overwrite existing files
--verbose

Verbose module output
--quiet

Quiet module output

Parameters:

input=name

Name of input vector map
output=name

Name for output vector map
type=string[,string,...]

Type
Feature type(s)
Options: point,line,boundary,centroid,area
Default: point,line,boundary,centroid,area
error=name

Name of output map where errors are written
tool=string[,string,...]

Cleaning tool
Options: break,snap,rmdangle,chdangle,rmbridge,chbridge,rmdupl,rmdac,bpol,prune,rmarea,rmline,rmsa
break: break lines at each intersection
snap: snap lines to vertex in threshold
rmdangle: remove dangles, threshold ignored if < 0
chdangle: change the type of boundary dangle to line, threshold ignored if < 0, input line type is ignored
rmbridge: remove bridges connecting area and island or 2 islands
chbridge: change the type of bridges connecting area and island or 2 islands from boundary to line
rmdupl: remove duplicate lines (pay attention to categories!)
rmdac: remove duplicate area centroids ('type' option ignored)
bpol: break (topologically clean) polygons (imported from non topological format, like ShapeFile). Boundaries are broken on each point shared between 2 and more polygons where angles of segments are different
prune: remove vertices in threshold from lines and boundaries, boundary is pruned only if topology is not damaged (new intersection, changed attachement of centroid), first and last segment of the boundary is never changed
rmarea: remove small areas, the longest boundary with adjacent area is removed
rmline: remove all lines or boundaries of zero length, threshold is ignored
rmsa: remove small angles between lines at nodes
thresh=float[,float,...]

Threshold
Threshold in map units, one value for each tool (default: 0.0[,0.0,...])

DESCRIPTION

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

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 demonstrate what the tool does.

       |

       |
tool=rmsa

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 rs

        error=intersection tool=break

Remove all lines of zero length


v.out.ascii zero format=standard
L 2 1

 -819832.09065589 -987825.2187231

 -806227.28362601 -971104.80702988

 1     1         
L 2 1

 -799165.24638913 -972974.16982788

 -799165.24638913 -972974.16982788

 1     2         

v.clean input=zero output=zero_clean tool=rmline type=line

v.out.ascii zero_clean format=standard
L 2 1

 -819832.09065589 -987825.2187231

 -806227.28362601 -971104.80702988

 1     1         

AUTHORS

David Gerdes, U.S. Army Construction Engineering Research Laboratory
Radim Blazek, ITC-irst, Trento, Italy
Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy

Last changed: $Date: 2007-07-13 17:17:33 +0200 (Fri, 13 Jul 2007) $

Full index

© 2003-2008 GRASS Development Team