[GRASS-SVN] r55699 - in grass/trunk: lib/vector/Vlib vector/v.out.ascii
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 11 02:20:15 PDT 2013
Author: martinl
Date: 2013-04-11 02:20:14 -0700 (Thu, 11 Apr 2013)
New Revision: 55699
Modified:
grass/trunk/lib/vector/Vlib/ascii.c
grass/trunk/vector/v.out.ascii/args.c
Log:
v.out.ascii: more guisections
Modified: grass/trunk/lib/vector/Vlib/ascii.c
===================================================================
--- grass/trunk/lib/vector/Vlib/ascii.c 2013-04-11 09:18:10 UTC (rev 55698)
+++ grass/trunk/lib/vector/Vlib/ascii.c 2013-04-11 09:20:14 UTC (rev 55699)
@@ -5,7 +5,7 @@
Higher level functions for reading/writing/manipulating vectors.
- (C) 2001-2009, 2011-2012 by the GRASS Development Team
+ (C) 2001-2009, 2011-2013 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 for details.
@@ -284,6 +284,8 @@
/*!
\brief Write data to GRASS ASCII vector format
+ Prints message if some features without category are skipped.
+
\param[out] ascii pointer to the output ASCII file
\param[out] att att file (< version 5 only)
\param Map pointer to Map_info structure
@@ -317,7 +319,7 @@
size_t xsize, ysize, zsize;
struct Cell_head window;
struct ilist *fcats;
- int count;
+ int count, n_skipped;
/* where || columns */
struct field_info *Fi;
@@ -477,7 +479,7 @@
Vect_rewind(Map);
- line = 0;
+ n_skipped = line = 0;
while (TRUE) {
ltype = Vect_read_next_line(Map, Points, Cats);
if (ltype == -1 ) { /* failure */
@@ -530,9 +532,13 @@
}
}
- if (!found)
+ if (!found) {
+ if (Cats->n_cats < 1)
+ n_skipped++;
+
continue;
-
+ }
+
if (ver < 5) {
Vect_cat_get(Cats, 1, &cat);
}
@@ -822,6 +828,10 @@
}
}
+ if (n_skipped > 0)
+ G_important_message(_("%d features without category skipped. To export also "
+ "features without category use '%s=-1'."), n_skipped, "layer");
+
Vect_destroy_line_struct(Points);
Vect_destroy_cats_struct(Cats);
Vect_destroy_cats_struct(ACats);
Modified: grass/trunk/vector/v.out.ascii/args.c
===================================================================
--- grass/trunk/vector/v.out.ascii/args.c 2013-04-11 09:18:10 UTC (rev 55698)
+++ grass/trunk/vector/v.out.ascii/args.c 2013-04-11 09:20:14 UTC (rev 55699)
@@ -32,7 +32,8 @@
"or ASCII vector name if '-o' is defined");
output_opt->description = _("If not given or '-' then standard output");
output_opt->required = NO;
-
+ output_opt->guisection = _("Output");
+
column_opt = G_define_standard_option(G_OPT_DB_COLUMNS);
column_opt->label = _("Name of attribute column(s) to be exported (point mode)");
column_opt->description = _("\"*\" for all columns");
@@ -77,6 +78,7 @@
old_flag = G_define_flag();
old_flag->key = 'o';
old_flag->description = _("Create old (version 4) ASCII file");
+ old_flag->guisection = _("Output");
header_flag = G_define_flag();
header_flag->key = 'c';
More information about the grass-commit
mailing list