[GRASS-SVN] r39546 - in grass/trunk: include/vect lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 17 11:30:33 EDT 2009


Author: martinl
Date: 2009-10-17 11:30:32 -0400 (Sat, 17 Oct 2009)
New Revision: 39546

Modified:
   grass/trunk/include/vect/dig_defines.h
   grass/trunk/lib/vector/Vlib/close.c
   grass/trunk/lib/vector/Vlib/open.c
Log:
GV_FORMAT_OGR_DIRECT added


Modified: grass/trunk/include/vect/dig_defines.h
===================================================================
--- grass/trunk/include/vect/dig_defines.h	2009-10-17 14:54:16 UTC (rev 39545)
+++ grass/trunk/include/vect/dig_defines.h	2009-10-17 15:30:32 UTC (rev 39546)
@@ -91,9 +91,11 @@
   Don't change GV_FORMAT_* values, this order is hardcoded in lib
 */
 /*! \brief GRASS native format */
-#define GV_FORMAT_NATIVE   0
-/*! \brief OGR format */
-#define GV_FORMAT_OGR      1
+#define GV_FORMAT_NATIVE     0
+/*! \brief OGR format (for layers linked via v.external) */
+#define GV_FORMAT_OGR        1
+/*! \brief OGR format (direct access) */
+#define GV_FORMAT_OGR_DIRECT 2
 
 /*! \brief One table linked to vector map */
 #define GV_1TABLE  0

Modified: grass/trunk/lib/vector/Vlib/close.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close.c	2009-10-17 14:54:16 UTC (rev 39545)
+++ grass/trunk/lib/vector/Vlib/close.c	2009-10-17 15:30:32 UTC (rev 39546)
@@ -106,9 +106,10 @@
     else {
 	/* spatial index must also be closed when opened with topo but not modified */
 	/* NOTE: also close sidx for GV_FORMAT_OGR if not direct OGR access */
-	if (Map->plus.Spidx_built == 1 && Map->plus.built == GV_BUILD_ALL)
-	    if (strcasecmp(Map->mapset, "ogr") != 0)
-		Vect_save_sidx(Map);
+	if (Map->format != GV_FORMAT_OGR_DIRECT &&
+	    Map->plus.Spidx_built == 1 &&
+	    Map->plus.built == GV_BUILD_ALL)
+	    Vect_save_sidx(Map);
     }
 
     if (Map->level == 2 && Map->plus.release_support) {

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2009-10-17 14:54:16 UTC (rev 39545)
+++ grass/trunk/lib/vector/Vlib/open.c	2009-10-17 15:30:32 UTC (rev 39546)
@@ -216,7 +216,7 @@
 
     /* Read vector format information */
     if (ogr_mapset) {
-	format = GV_FORMAT_OGR;
+	format = GV_FORMAT_OGR_DIRECT;
     }
     else {
 	format = 0;
@@ -733,6 +733,7 @@
 #endif
 	break;
     case GV_FORMAT_OGR:
+    case GV_FORMAT_OGR_DIRECT:
 	Info->size = 0L;
 	Info->mtime = 0L;
 	break;
@@ -767,6 +768,7 @@
 	sprintf(maptype, "native");
 	break;
     case GV_FORMAT_OGR:
+    case GV_FORMAT_OGR_DIRECT:
 	sprintf(maptype, "ogr");
 	break;
     default:



More information about the grass-commit mailing list