[GRASS-SVN] r55505 - grass/trunk/vector/v.external.out
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 23 09:56:41 PDT 2013
Author: martinl
Date: 2013-03-23 09:56:41 -0700 (Sat, 23 Mar 2013)
New Revision: 55505
Modified:
grass/trunk/vector/v.external.out/link.c
grass/trunk/vector/v.external.out/main.c
Log:
v.external.out: add some verbose messages
Modified: grass/trunk/vector/v.external.out/link.c
===================================================================
--- grass/trunk/vector/v.external.out/link.c 2013-03-23 00:42:48 UTC (rev 55504)
+++ grass/trunk/vector/v.external.out/link.c 2013-03-23 16:56:41 UTC (rev 55505)
@@ -138,6 +138,14 @@
G_fatal_error(_("Error writing <%s> file"), filename);
fclose(fp);
+
+ if (use_ogr)
+ G_verbose_message(_("Switched to OGR format (%s)"),
+ G_find_key_value("format", key_val));
+ else
+ G_verbose_message(_("Switched to PostGIS format"));
+
+ G_free_key_value(key_val);
}
char *get_option_pg(char **options, const char *key)
Modified: grass/trunk/vector/v.external.out/main.c
===================================================================
--- grass/trunk/vector/v.external.out/main.c 2013-03-23 00:42:48 UTC (rev 55504)
+++ grass/trunk/vector/v.external.out/main.c 2013-03-23 16:56:41 UTC (rev 55505)
@@ -3,11 +3,12 @@
*
* MODULE: v.external.out
*
- * AUTHOR(S): Martin Landa <landa.martin gmail.com> (based on r.external.out code)
+ * AUTHOR(S): Martin Landa <landa.martin gmail.com>
*
* PURPOSE: Make GRASS write vector maps utilizing the OGR library.
+ * (Partly based on r.external.out code)
*
- * COPYRIGHT: (C) 2010 by Martin Landa and the GRASS Development Team
+ * COPYRIGHT: (C) 2010-2013 by Martin Landa and the GRASS Development Team
*
* This program is free software under the GNU General
* Public License (>=v2). Read the file COPYING that
@@ -58,9 +59,14 @@
}
if (flags.r->answer) {
- if (G_remove("", "OGR") == 0)
- G_remove("", "PG");
- exit(EXIT_SUCCESS);
+ if (G_remove("", "OGR") == 1) {
+ G_verbose_message(_("Switched from OGR to native format"));
+ }
+ else {
+ if (G_remove("", "PG") == 1)
+ G_verbose_message(_("Switched from PostGIS to native format"));
+ }
+ exit(EXIT_SUCCESS);
}
format = NULL;
@@ -75,7 +81,7 @@
}
if (flags.p->answer || flags.g->answer) {
- print_status(flags.g->answer ? 1 : 0);
+ print_status(flags.g->answer ? TRUE : FALSE);
}
exit(EXIT_SUCCESS);
More information about the grass-commit
mailing list