[GRASS-SVN] r64269 - in grass/trunk/lib/vector: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 20 18:36:57 PST 2015


Author: wenzeslaus
Date: 2015-01-20 18:36:57 -0800 (Tue, 20 Jan 2015)
New Revision: 64269

Added:
   grass/trunk/lib/vector/testsuite/
   grass/trunk/lib/vector/testsuite/test_topology_vgeneralize.sh
Log:
add topology test which uses v.generalize debug mode (author: mmetz)

See also: Planning GRASS GIS 7.0.0RC1, http://lists.osgeo.org/pipermail/grass-dev/2015-January/073231.html


Added: grass/trunk/lib/vector/testsuite/test_topology_vgeneralize.sh
===================================================================
--- grass/trunk/lib/vector/testsuite/test_topology_vgeneralize.sh	                        (rev 0)
+++ grass/trunk/lib/vector/testsuite/test_topology_vgeneralize.sh	2015-01-21 02:36:57 UTC (rev 64269)
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+############################################################################
+#
+# TEST:         test_topology_vgeneralize
+# AUTHOR(S):    Markus Metz
+#
+# PURPOSE:      Tests if the topology is correct using v.generalize debug mode
+# COPYRIGHT:    (C) 2011-2014 by Markus Metz and the GRASS Development Team
+#
+#               This program is free software under the GNU General Public
+#               License (version 2). Read the file COPYING that comes with GRASS
+#               for details.
+#
+#############################################################################
+
+# The vectors in the sample datasets are "too good", I did not find a
+# vector to provoke any errors, thus the r.to.vect step.
+
+# Real world datasets, particularly vectors with administrative areas or
+# land cover/land use classification, are in this respect more suitable
+# because they contain lots of topological errors. Unfortunately, these
+# datasets are too large to be included in the sample datasets.
+
+# the script expects to run using shell with -e flag
+# (equivalent of set -e in a script)
+
+# prepare
+g.region rast=landuse96_28m
+r.to.vect input=landuse96_28m output=landuse96_28m type=area
+
+# use the v.generalize debug mode
+export GRASS_VECTOR_TOPO_DEBUG=1
+
+# test will fail if this (and any other) command fails
+v.generalize input=landuse96_28m output=landuse96_28m_dp method=douglas threshold=21
+
+# clean up (executed if successful)
+g.remove -f type=vector name=landuse96_28m
+g.remove -f type=raster name=landuse96_28m_dp



More information about the grass-commit mailing list