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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 11 07:28:04 EST 2012


Author: martinl
Date: 2012-02-11 04:28:04 -0800 (Sat, 11 Feb 2012)
New Revision: 50763

Modified:
   grass/trunk/lib/vector/Vlib/build_ogr.c
Log:
vlib/ogr: random access for OGR/PostgreSQL layers requires primary key - inform user about that


Modified: grass/trunk/lib/vector/Vlib/build_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_ogr.c	2012-02-11 12:26:50 UTC (rev 50762)
+++ grass/trunk/lib/vector/Vlib/build_ogr.c	2012-02-11 12:28:04 UTC (rev 50763)
@@ -75,6 +75,10 @@
 
     /* test layer capabilities */
     if (!OGR_L_TestCapability(ogr_info->layer, OLCRandomRead)) {
+	if (strcmp(OGR_Dr_GetName(OGR_DS_GetDriver(Map->fInfo.ogr.ds)),
+		   "PostgreSQL") == 0)
+	    G_warning(_("Feature table <%s> has no primary key defined"),
+		      ogr_info->layer_name);
 	G_warning(_("Random read is not supported by OGR for this layer, "
 		    "unable to build topology"));
 	return 0;



More information about the grass-commit mailing list