فهرست منبع

vlib: document GRASS_VECTOR_EXTERNAL_IMMEDIATE variable

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55410 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 سال پیش
والد
کامیت
8dcf9aa714
3فایلهای تغییر یافته به همراه17 افزوده شده و 4 حذف شده
  1. 13 0
      lib/init/variables.html
  2. 2 2
      lib/vector/Vlib/close.c
  3. 2 2
      lib/vector/Vlib/open.c

+ 13 - 0
lib/init/variables.html

@@ -244,6 +244,19 @@ PERMANENT
     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>

+ 2 - 2
lib/vector/Vlib/close.c

@@ -85,7 +85,7 @@ int Vect_close(struct Map_info *Map)
         /* 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 @@ int Vect_close(struct Map_info *Map)
         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 */

+ 2 - 2
lib/vector/Vlib/open.c

@@ -1200,7 +1200,7 @@ int map_format(struct Map_info *Map)
         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 @@ int map_format(struct Map_info *Map)
             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;
             }