浏览代码

v.select: don't skip features without category implemeneted as a flag

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44036 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 年之前
父节点
当前提交
f961e2b83a
共有 3 个文件被更改,包括 10 次插入6 次删除
  1. 5 1
      vector/v.select/args.c
  2. 4 4
      vector/v.select/main.c
  3. 1 1
      vector/v.select/proto.h

+ 5 - 1
vector/v.select/args.c

@@ -76,7 +76,11 @@ void parse_options(struct GParm *parm, struct GFlag *flag)
     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");

+ 4 - 4
vector/v.select/main.c

@@ -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 @@ int main(int argc, char *argv[])
 	    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 @@ int main(int argc, char *argv[])
 		    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 @@ int main(int argc, char *argv[])
 
 		    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;
 		    }

+ 1 - 1
vector/v.select/proto.h

@@ -16,7 +16,7 @@ struct GParm {
 	*operator, *relate;
 };
 struct GFlag {
-    struct Flag *table, *reverse, *geos;
+    struct Flag *table, *reverse, *geos, *cat;
 };
 
 /* args.c */