[GRASS-SVN] r55410 - in grass/trunk/lib: init vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 17 07:41:14 PDT 2013


Author: martinl
Date: 2013-03-17 07:41:14 -0700 (Sun, 17 Mar 2013)
New Revision: 55410

Modified:
   grass/trunk/lib/init/variables.html
   grass/trunk/lib/vector/Vlib/close.c
   grass/trunk/lib/vector/Vlib/open.c
Log:
vlib: document GRASS_VECTOR_EXTERNAL_IMMEDIATE variable


Modified: grass/trunk/lib/init/variables.html
===================================================================
--- grass/trunk/lib/init/variables.html	2013-03-17 14:18:28 UTC (rev 55409)
+++ grass/trunk/lib/init/variables.html	2013-03-17 14:41:14 UTC (rev 55410)
@@ -244,6 +244,19 @@
     PostgreSQL, vector data is written by OGR data provider even
     the native PostGIS data provider is available.</dd>
 
+  <dt>GRASS_VECTOR_EXTERNAL_IMMEDIATE</dt>
+  <dd>[vectorlib, v.external.out]<br> If the environment variable
+    GRASS_VECTOR_EXTERNAL_IMMEDIATE exists and vector output format
+    defined
+    by <em><a href="v.external.out.html">v.external.out</a></em> is
+    non-native, vector features are written to output external
+    datasource immediately. By default, the vector library writes
+    output data to a temporary vector map in native format and when
+    closing the map, the features are transfered to output external
+    datasource. Note: if output vector format is topological PostGIS
+    format, then the vector library writes features immediately to output
+    database (in this case GRASS_VECTOR_EXTERNAL_IMMEDIATE is ignored).</dd>
+
   <dt>GRASS_WXBUNDLED</dt>
   <dd>[wxGUI]<br>
     set to tell wxGUI that a bundled wxPython will be used.<br>

Modified: grass/trunk/lib/vector/Vlib/close.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close.c	2013-03-17 14:18:28 UTC (rev 55409)
+++ grass/trunk/lib/vector/Vlib/close.c	2013-03-17 14:41:14 UTC (rev 55410)
@@ -85,7 +85,7 @@
         /* transfer features for external output format */
         struct Map_info Out;
         
-        putenv("GRASS_VECTOR_EXTERNAL_DIRECT=1");
+        putenv("GRASS_VECTOR_EXTERNAL_IMMEDIATE=1");
         if (-1 == Vect_open_new(&Out, Vect_get_name(Map), Vect_is_3d(Map))) {
             G_warning(_("Unable to create vector map <%s>"),
                       Vect_get_name(Map));
@@ -103,7 +103,7 @@
         Vect_build(&Out);
         
         Vect_close(&Out);
-        putenv("GRASS_VECTOR_EXTERNAL_DIRECT="); /* unset variable */
+        putenv("GRASS_VECTOR_EXTERNAL_IMMEDIATE="); /* unset variable */
     }
     
     /* check for external formats whether to create a link */

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2013-03-17 14:18:28 UTC (rev 55409)
+++ grass/trunk/lib/vector/Vlib/open.c	2013-03-17 14:41:14 UTC (rev 55410)
@@ -1200,7 +1200,7 @@
         struct Format_info_ogr *ogr_info;
         
         G_debug(2, " using OGR format");
-        if (getenv("GRASS_VECTOR_EXTERNAL_DIRECT")) {
+        if (getenv("GRASS_VECTOR_EXTERNAL_IMMEDIATE")) {
             /* vector features are written directly to OGR layer */
             format = GV_FORMAT_OGR;
         }
@@ -1305,7 +1305,7 @@
             p = G_find_key_value("topology", key_val);
             topology = p && G_strcasecmp(p, "yes") == 0;
         
-            if (topology || getenv("GRASS_VECTOR_EXTERNAL_DIRECT")) {
+            if (topology || getenv("GRASS_VECTOR_EXTERNAL_IMMEDIATE")) {
                 /* vector features are written directly to PostGIS layer */
                 format = GV_FORMAT_POSTGIS;
             }



More information about the grass-commit mailing list