[GRASS-SVN] r39197 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 14 08:18:53 EDT 2009


Author: martinl
Date: 2009-09-14 08:18:53 -0400 (Mon, 14 Sep 2009)
New Revision: 39197

Modified:
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/lib/vector/Vlib/open_ogr.c
Log:
don't fail if OGR layer name is defined


Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2009-09-14 11:46:09 UTC (rev 39196)
+++ grass/trunk/lib/vector/Vlib/open.c	2009-09-14 12:18:53 UTC (rev 39197)
@@ -163,7 +163,9 @@
 	    G_debug(1, "OGR mapset detected");
 	    ogr_mapset = 1;
 	    Map->fInfo.ogr.dsn = G_store(xname);
-	    Map->fInfo.ogr.layer_name = G_store(layer); /* no layer to be open */
+	    if (layer) {
+		Map->fInfo.ogr.layer_name = G_store(layer); /* no layer to be open */
+	    }
 	}
 	else {
 	    sprintf(buf,  "%s/%s", GV_DIRECTORY, xname);

Modified: grass/trunk/lib/vector/Vlib/open_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_ogr.c	2009-09-14 11:46:09 UTC (rev 39196)
+++ grass/trunk/lib/vector/Vlib/open_ogr.c	2009-09-14 12:18:53 UTC (rev 39197)
@@ -58,12 +58,12 @@
     }
 
     if (!Map->fInfo.ogr.dsn) {
-	G_warning(_("OGR datasource not defined"));
+	G_fatal_error(_("OGR datasource not defined"));
 	return -1;
     }
     
     if (!Map->fInfo.ogr.layer_name) {
-	G_warning(_("OGR layer not defined"));
+	G_fatal_error(_("OGR layer not defined"));
 	return -1;
     }
     



More information about the grass-commit mailing list