浏览代码

v.net operation=turntable: fix for turntable name if output map is given with mapset name

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67756 15284696-431f-4ddb-bdfa-cd5b030d7da7
Štěpán Turek 9 年之前
父节点
当前提交
bef5225f74
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      vector/v.net/turntable.c

+ 7 - 6
vector/v.net/turntable.c

@@ -637,6 +637,12 @@ void turntable(struct opt *opt)
 	G_fatal_error(_("Unable to open vector map <%s>."),
 		      opt->input->answer);
     }
+
+    if (Vect_open_new(&OutMap, opt->output->answer, WITHOUT_Z) < 1) {
+	G_fatal_error(_("Unable to create vector map <%s>."),
+		      opt->output->answer);
+    }
+
     Vect_set_error_handler_io(&InMap, &OutMap);
 
     type = Vect_option_to_types(opt->type);
@@ -661,14 +667,9 @@ void turntable(struct opt *opt)
 
     ttb_name = NULL;
     G_asprintf(&ttb_name, "%s_turntable_t_%s_tuc_%s_a_%s",
-	       opt->output->answer, opt->tfield->answer,
+	       Vect_get_name(&OutMap), opt->tfield->answer,
 	       opt->tucfield->answer, opt->afield_opt->answer);
 
-    if (Vect_open_new(&OutMap, opt->output->answer, WITHOUT_Z) < 1) {
-	G_fatal_error(_("Unable to create vector map <%s>."),
-		      opt->output->answer);
-    }
-
     /*Use database and driver as layer with lowest number, 
        if the layer is not present use def settings. */
     field_num = -1;