[GRASS-SVN] r44036 - grass/trunk/vector/v.select

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 24 15:24:36 EDT 2010


Author: martinl
Date: 2010-10-24 12:24:36 -0700 (Sun, 24 Oct 2010)
New Revision: 44036

Modified:
   grass/trunk/vector/v.select/args.c
   grass/trunk/vector/v.select/main.c
   grass/trunk/vector/v.select/proto.h
Log:
v.select: don't skip features without category implemeneted as a flag


Modified: grass/trunk/vector/v.select/args.c
===================================================================
--- grass/trunk/vector/v.select/args.c	2010-10-24 17:22:46 UTC (rev 44035)
+++ grass/trunk/vector/v.select/args.c	2010-10-24 19:24:36 UTC (rev 44036)
@@ -76,7 +76,11 @@
     flag->table = G_define_flag();
     flag->table->key = 't';
     flag->table->description = _("Do not create attribute table");
-
+    
+    flag->cat = G_define_flag();
+    flag->cat->key = 'c';
+    flag->cat->description = _("Do not skip features without category");
+    
     flag->reverse = G_define_flag();
     flag->reverse->key = 'r';
     flag->reverse->description = _("Reverse selection");

Modified: grass/trunk/vector/v.select/main.c
===================================================================
--- grass/trunk/vector/v.select/main.c	2010-10-24 17:22:46 UTC (rev 44035)
+++ grass/trunk/vector/v.select/main.c	2010-10-24 19:24:36 UTC (rev 44036)
@@ -6,7 +6,7 @@
  *               Glynn Clements <glynn gclements.plus.com>, Markus Neteler <neteler itc.it>
  *               Martin Landa <landa.martin gmail.com> (GEOS support)
  * PURPOSE:      
- * COPYRIGHT:    (C) 2003-2009 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2003-2010 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -147,7 +147,7 @@
 	    G_percent(aline, nalines, 2);	/* must be before any continue */
 
 	    /* Check category */
-	    if (Vect_get_line_cat(&(In[0]), aline, ifield[0]) < 0) {
+	    if (!flag.cat->answer && Vect_get_line_cat(&(In[0]), aline, ifield[0]) < 0) {
 		nskipped++;
 		continue;
 	    }
@@ -190,7 +190,7 @@
 		    G_debug(3, "  bline = %d", bline);
 		    
 		    /* Check category */
-		    if (!Vect_get_line_cat(&(In[1]), bline, ifield[1]) < 0) {
+		    if (!flag.cat->answer && Vect_get_line_cat(&(In[1]), bline, ifield[1]) < 0) {
 			nskipped++;
 			continue;
 		    }
@@ -303,7 +303,7 @@
 
 		    bline = List->value[i];
 
-		    if (Vect_get_line_cat(&(In[1]), bline, ifield[1]) < 0) {
+		    if (!flag.cat->answer && Vect_get_line_cat(&(In[1]), bline, ifield[1]) < 0) {
 			nskipped++;
 			continue;
 		    }

Modified: grass/trunk/vector/v.select/proto.h
===================================================================
--- grass/trunk/vector/v.select/proto.h	2010-10-24 17:22:46 UTC (rev 44035)
+++ grass/trunk/vector/v.select/proto.h	2010-10-24 19:24:36 UTC (rev 44036)
@@ -16,7 +16,7 @@
 	*operator, *relate;
 };
 struct GFlag {
-    struct Flag *table, *reverse, *geos;
+    struct Flag *table, *reverse, *geos, *cat;
 };
 
 /* args.c */



More information about the grass-commit mailing list