فهرست منبع

v.out.ascii: use topology only when needed (maintain support for massive point export)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48889 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 13 سال پیش
والد
کامیت
7551508667
1فایلهای تغییر یافته به همراه13 افزوده شده و 4 حذف شده
  1. 13 4
      vector/v.out.ascii/main.c

+ 13 - 4
vector/v.out.ascii/main.c

@@ -69,10 +69,19 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("'output' must be given for old version"));
     }
 
-    if (Vect_open_old2(&Map, input, "", field_name) < 2) /* topology required for areas */
-	G_warning(_("Unable to open vector map <%s> at topology level. "
-		    "Areas will not be processed."),
-		  input);
+    /* open with topology only if needed */
+    if (format == GV_ASCII_FORMAT_WKT || (format == GV_ASCII_FORMAT_STD && 
+	(where || clist))) {
+	if (Vect_open_old2(&Map, input, "", field_name) < 2) /* topology required for areas */
+	    G_warning(_("Unable to open vector map <%s> at topology level. "
+			"Areas will not be processed."),
+		      input);
+    }
+    else {
+	Vect_set_open_level(1); /* topology not needed */ 
+	if (Vect_open_old2(&Map, input, "", field_name) < 0) 
+	    G_fatal_error(_("Unable to open vector map <%s>"), input); 
+    }
     
     field = Vect_get_field_number(&Map, field_name);