[GRASS-SVN] r48889 - grass/trunk/vector/v.out.ascii

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 21 04:14:22 EDT 2011


Author: mmetz
Date: 2011-10-21 01:14:22 -0700 (Fri, 21 Oct 2011)
New Revision: 48889

Modified:
   grass/trunk/vector/v.out.ascii/main.c
Log:
v.out.ascii: use topology only when needed (maintain support for massive point export)

Modified: grass/trunk/vector/v.out.ascii/main.c
===================================================================
--- grass/trunk/vector/v.out.ascii/main.c	2011-10-21 08:11:51 UTC (rev 48888)
+++ grass/trunk/vector/v.out.ascii/main.c	2011-10-21 08:14:22 UTC (rev 48889)
@@ -69,10 +69,19 @@
 	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);
     



More information about the grass-commit mailing list