2
############################################################################
5
# AUTHOR(S): Glynn Clements, Radim Blazek
6
# PURPOSE: Build all vectors in current mapset
7
# COPYRIGHT: (C) 2004, 2008-2009 by the GRASS Development Team
9
# This program is free software under the GNU General Public
10
# License (>=v2). Read the file COPYING that comes with GRASS
13
#############################################################################
16
#% description: Rebuilds topology on all vector maps in the current mapset.
22
from grass.script import core as grass
23
from grass.exceptions import CalledModuleError
27
mapset = env['MAPSET']
30
vectors = grass.list_grouped('vect')[mapset]
31
num_vectors = len(vectors)
33
if grass.verbosity() < 2:
40
map = "%s@%s" % (vect, mapset)
41
grass.message(_("%s\nBuilding topology for vector map <%s> (%d of %d)...\n%s") % \
42
('-' * 80, map, i, num_vectors, '-' * 80))
43
grass.verbose(_("v.build map=%s") % map)
45
grass.run_command("v.build", map=map, quiet=quiet)
46
except CalledModuleError:
47
grass.error(_("Building topology for vector map <%s> failed") % map)
54
if __name__ == "__main__":
55
options, flags = grass.parser()