[GRASS-SVN] r56473 - grass/trunk/vector/v.in.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 29 05:12:04 PDT 2013


Author: martinl
Date: 2013-05-29 05:12:04 -0700 (Wed, 29 May 2013)
New Revision: 56473

Modified:
   grass/trunk/vector/v.in.ogr/main.c
Log:
v.in.ogr: create tmp map by Vect_open_tmp_new()


Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c	2013-05-29 12:10:46 UTC (rev 56472)
+++ grass/trunk/vector/v.in.ogr/main.c	2013-05-29 12:12:04 UTC (rev 56473)
@@ -9,7 +9,7 @@
  *
  * PURPOSE:      Import OGR vectors
  *
- * COPYRIGHT:    (C) 2003, 2011 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2003, 2011-2013 by the GRASS Development Team
  *
  *               This program is free software under the GNU General
  *               Public License (>=v2).  Read the file COPYING that
@@ -65,7 +65,7 @@
     double xmin, ymin, xmax, ymax;
     int ncols = 0, type;
     double min_area, snap;
-    char buf[2000], namebuf[2000], tempvect[GNAME_MAX];
+    char buf[2000], namebuf[2000];
     char *separator;
     
     struct Key_Value *loc_proj_info, *loc_proj_units;
@@ -809,9 +809,8 @@
 	     * at the end copy alive lines to output vector
 	     * in case of polygons this reduces the coor file size by a factor of 2 to 5
 	     * only needed when cleaning polygons */
-	    sprintf(tempvect, "%s_tmp", output);
-	    G_verbose_message(_("Using temporary vector <%s>"), tempvect);
-	    Vect_open_new(&Tmp, tempvect, with_z);
+	    Vect_open_tmp_new(&Tmp, NULL, with_z);
+	    G_verbose_message(_("Using temporary vector <%s>"), Vect_get_name(&Tmp));
 	    Out = &Tmp;
 	}
     }
@@ -1338,8 +1337,7 @@
 	Vect_copy_map_lines(&Tmp, &Map);
 	/* release memory occupied by topo, we may need that memory for main output */
 	Vect_set_release_support(&Tmp);
-	Vect_close(&Tmp);
-	Vect_delete(tempvect);
+	Vect_close(&Tmp); /* temporary map is deleted automatically */
     }
 
     Vect_build(&Map);



More information about the grass-commit mailing list