[GRASS-SVN] r55698 - grass/trunk/vector/v.out.ascii
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 11 02:18:10 PDT 2013
Author: martinl
Date: 2013-04-11 02:18:10 -0700 (Thu, 11 Apr 2013)
New Revision: 55698
Modified:
grass/trunk/vector/v.out.ascii/args.c
grass/trunk/vector/v.out.ascii/main.c
grass/trunk/vector/v.out.ascii/v.out.ascii.html
Log:
v.out.ascii: layer=-1 -> exports also features without category
update manual
parameter 'output' optional
Modified: grass/trunk/vector/v.out.ascii/args.c
===================================================================
--- grass/trunk/vector/v.out.ascii/args.c 2013-04-10 22:53:25 UTC (rev 55697)
+++ grass/trunk/vector/v.out.ascii/args.c 2013-04-11 09:18:10 UTC (rev 55698)
@@ -20,17 +20,18 @@
input_opt = G_define_standard_option(G_OPT_V_INPUT);
- field_opt = G_define_standard_option(G_OPT_V_FIELD);
+ field_opt = G_define_standard_option(G_OPT_V_FIELD_ALL);
field_opt->guisection = _("Selection");
-
+ field_opt->answer = "1";
+
type_opt = G_define_standard_option(G_OPT_V3_TYPE);
type_opt->guisection = _("Selection");
output_opt = G_define_standard_option(G_OPT_F_OUTPUT);
output_opt->label = _("Name for output ASCII file "
"or ASCII vector name if '-o' is defined");
- output_opt->description = _("'-' for standard output");
- output_opt->answer = "-";
+ output_opt->description = _("If not given or '-' then standard output");
+ output_opt->required = NO;
column_opt = G_define_standard_option(G_OPT_DB_COLUMNS);
column_opt->label = _("Name of attribute column(s) to be exported (point mode)");
@@ -92,7 +93,10 @@
exit(EXIT_FAILURE);
*input = G_store(input_opt->answer);
- *output = G_store(output_opt->answer);
+ if (output_opt->answer)
+ *output = G_store(output_opt->answer);
+ else
+ *output = G_store("-"); /* standard output */
if (format_opt->answer[0] == 'p')
*format = GV_ASCII_FORMAT_POINT;
else if (format_opt->answer[0] == 's')
Modified: grass/trunk/vector/v.out.ascii/main.c
===================================================================
--- grass/trunk/vector/v.out.ascii/main.c 2013-04-10 22:53:25 UTC (rev 55697)
+++ grass/trunk/vector/v.out.ascii/main.c 2013-04-11 09:18:10 UTC (rev 55698)
@@ -47,15 +47,17 @@
G_add_keyword(_("vector"));
G_add_keyword(_("export"));
G_add_keyword(_("ascii"));
- module->description =
+ module->label =
_("Exports a vector map to a GRASS ASCII vector representation.");
+ module->description = _("By default only features with category are exported. "
+ "To export all features use 'layer=-1'.");
parse_args(argc, argv, &input, &output, &format, &dp, &delim,
&field_name, &columns, &where, ®ion, &old_format, &header,
&cats, &type);
if (format == GV_ASCII_FORMAT_STD && columns) {
- G_warning(_("Parameter 'column' ignored in standard mode"));
+ G_warning(_("Parameter '%s' ignored in standard mode"), "column");
}
ver = 5;
@@ -64,11 +66,11 @@
ver = 4;
if (ver == 4 && format == GV_ASCII_FORMAT_POINT) {
- G_fatal_error(_("Format 'point' is not supported for old version"));
+ G_fatal_error(_("Format '%s' is not supported for old version"), "point");
}
if (ver == 4 && strcmp(output, "-") == 0) {
- G_fatal_error(_("'output' must be given for old version"));
+ G_fatal_error(_("Parameter '%s' must be given for old version"), "output");
}
/* open with topology only if needed */
Modified: grass/trunk/vector/v.out.ascii/v.out.ascii.html
===================================================================
--- grass/trunk/vector/v.out.ascii/v.out.ascii.html 2013-04-10 22:53:25 UTC (rev 55697)
+++ grass/trunk/vector/v.out.ascii/v.out.ascii.html 2013-04-11 09:18:10 UTC (rev 55698)
@@ -5,24 +5,26 @@
flag <b>-o</b> <em>v.out.ascii</em> output will be in old (version 4)
ASCII format.
-<p>If the <b>output</b> parameter is not given then the coordinates of any
-<em>point</em> data within the vector map is sent to stdout.
+<p>If the <b>output</b> parameter is not given then the data is sent
+to standard output.
<h2>NOTES</h2>
The <em><a href="v.in.ascii.html">v.in.ascii</a></em> module performs
the function of <em>v.out.ascii</em> in reverse; i.e. it converts
-vector maps in ASCII format to their binary format. These two
+vector maps in ASCII format to their binary format. These two
companion module are useful both for importing and exporting vector
maps between GRASS and other software, and for transferring data
between machines.
-<p>If old version is requested, the <b>output</b> files from <em>v.out.ascii</em> is placed
-in the <tt>$LOCATION/$MAPSET/dig_ascii/</tt> and <tt>$LOCATION/$MAPSET/dig_att</tt> directory.
+<p>If old version is requested, the <b>output</b> files
+from <em>v.out.ascii</em> is placed in
+the <tt>$LOCATION/$MAPSET/dig_ascii/</tt>
+and <tt>$LOCATION/$MAPSET/dig_att</tt> directory.
-<p>Only features with a category number will be
-exported. Use <em><a href="v.category.html">v.category</a></em> to add
-them if needed.
+<p>If <b>layer > 0</b> then only features with a category number
+will be exported. Use <em><a href="v.category.html">v.category</a></em> to add
+them if needed or define <b>layer=-1</b> to export also features without category.
<p><em>v.out.ascii</em> in the old version mode (<b>-o</b>) does not
copy the <tt>dig_cats</tt> file associated with the binary
@@ -147,4 +149,5 @@
Attribute selection added by Martin Landa, Czech Technical University
in Prague, Czech Republic (2008/12)
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>
More information about the grass-commit
mailing list