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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 16 11:19:25 EDT 2009


Author: martinl
Date: 2009-10-16 11:19:24 -0400 (Fri, 16 Oct 2009)
New Revision: 39529

Modified:
   grass/trunk/vector/v.out.ogr/main.c
Log:
v.out.ogr: respect '--overwrite'


Modified: grass/trunk/vector/v.out.ogr/main.c
===================================================================
--- grass/trunk/vector/v.out.ogr/main.c	2009-10-16 15:09:16 UTC (rev 39528)
+++ grass/trunk/vector/v.out.ogr/main.c	2009-10-16 15:19:24 UTC (rev 39529)
@@ -287,6 +287,12 @@
 	G_fatal_error(_("Unable to open OGR data source '%s'"),
 		      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);
+    }
+    
     /* check if the map is 3d */
     if (Vect_is_3d(&In)) {
 	/* specific check for shp */



More information about the grass-commit mailing list