[GRASS-SVN] r39580 - grass/trunk/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 19 04:55:33 EDT 2009


Author: martinl
Date: 2009-10-19 04:55:31 -0400 (Mon, 19 Oct 2009)
New Revision: 39580

Modified:
   grass/trunk/vector/v.out.ogr/main.c
Log:
v.out.ogr: --o adds OVERWRITE=YES to lcos


Modified: grass/trunk/vector/v.out.ogr/main.c
===================================================================
--- grass/trunk/vector/v.out.ogr/main.c	2009-10-19 08:44:44 UTC (rev 39579)
+++ grass/trunk/vector/v.out.ogr/main.c	2009-10-19 08:55:31 UTC (rev 39580)
@@ -287,9 +287,16 @@
 		      options.dsn->answer);
 
     /* check if OGR layer exists */
-    if (!G_check_overwrite(argc, argv) && OGR_DS_GetLayerByName(Ogr_ds, options.layer->answer)) {
-	G_fatal_error(_("OGR layer <%s> already exists in '%s'"),
-		options.layer->answer, options.dsn->answer);
+    if (OGR_DS_GetLayerByName(Ogr_ds, options.layer->answer)) {
+	if (!G_check_overwrite(argc, argv)) {
+	    G_fatal_error(_("OGR layer <%s> already exists in '%s'"),
+			  options.layer->answer, options.dsn->answer);
+	}
+	else {
+	    G_warning(_("OGR layer <%s> already exists and will be overwritten"),
+		      options.layer->answer);
+	    papszLCO = CSLSetNameValue(papszLCO, "OVERWRITE", "YES");
+	}
     }
     
     /* check if the map is 3d */



More information about the grass-commit mailing list