[GRASS-SVN] r38371 - grass/trunk/vector/v.external

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 12 05:25:58 EDT 2009


Author: martinl
Date: 2009-07-12 05:25:58 -0400 (Sun, 12 Jul 2009)
New Revision: 38371

Modified:
   grass/trunk/vector/v.external/main.c
Log:
v.external: flag to skip building topology


Modified: grass/trunk/vector/v.external/main.c
===================================================================
--- grass/trunk/vector/v.external/main.c	2009-07-12 09:21:28 UTC (rev 38370)
+++ grass/trunk/vector/v.external/main.c	2009-07-12 09:25:58 UTC (rev 38371)
@@ -4,6 +4,7 @@
  * MODULE:       v.external
  * 
  * AUTHOR(S):    Radim Blazek
+ *               Updated by Martin Landa <landa.martin gmail.com> (2009)
  *               
  * PURPOSE:      Create a new vector as a link to OGR layer (read-only)
  *               
@@ -42,7 +43,7 @@
     } options;
 
     struct {
-	struct Flag *format, *layer;
+      struct Flag *format, *layer, *topo;
     } flags;
     
     G_gisinit(argv[0]);
@@ -86,6 +87,10 @@
     flags.layer->key = 'l';
     flags.layer->description = _("List available layers and exit");
 
+    flags.topo = G_define_flag();
+    flags.topo->key = 'b';
+    flags.topo->description = _("Do not build topology");
+    
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
@@ -145,9 +150,13 @@
     
     fclose(fd);
     
-    Vect_open_old(&Map, options.output->answer, G_mapset());
-    Vect_build(&Map);
-    Vect_close(&Map);
+    if (!flags.topo->answer) {
+      Vect_open_old(&Map, options.output->answer, G_mapset());
+      Vect_build(&Map);
+      Vect_close(&Map);
+    }
 
+    G_done_msg(_("<%s> created."), options.output->answer);
+
     exit(EXIT_SUCCESS);
 }



More information about the grass-commit mailing list