Ver código fonte

v.clean cosmetics

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55270 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 anos atrás
pai
commit
c37b7d198f
2 arquivos alterados com 17 adições e 16 exclusões
  1. 13 13
      vector/v.clean/main.c
  2. 4 3
      vector/v.clean/split.c

+ 13 - 13
vector/v.clean/main.c

@@ -219,47 +219,47 @@ int main(int argc, char *argv[])
     for (i = 0; i < ntools; i++) {
 	switch (tools[i]) {
 	case (TOOL_BREAK):
-	    G_message("%s: %13e", _("Break"), threshs[i]);
+	    G_message("%s: %.15g", _("Break"), threshs[i]);
 	    break;
 	case (TOOL_RMDUPL):
-	    G_message("%s: %13e", _("Remove duplicates"), threshs[i]);
+	    G_message("%s: %.15g", _("Remove duplicates"), threshs[i]);
 	    break;
 	case (TOOL_RMDANGLE):
-	    G_message("%s: %13e", _("Remove dangles"), threshs[i]);
+	    G_message("%s: %.15g", _("Remove dangles"), threshs[i]);
 	    break;
 	case (TOOL_CHDANGLE):
-	    G_message("%s: %13e", _("Change type of boundary dangles"),
+	    G_message("%s: %.15g", _("Change type of boundary dangles"),
 		      threshs[i]);
 	    break;
 	case (TOOL_RMBRIDGE):
-	    G_message("%s: %13e", _("Remove bridges"), threshs[i]);
+	    G_message("%s: %.15g", _("Remove bridges"), threshs[i]);
 	    break;
 	case (TOOL_CHBRIDGE):
-	    G_message("%s: %13e", _("Change type of boundary bridges"),
+	    G_message("%s: %.15g", _("Change type of boundary bridges"),
 		      threshs[i]);
 	    break;
 	case (TOOL_SNAP):
-	    G_message("%s: %13e", _("Snap vertices"), threshs[i]);
+	    G_message("%s: %.15g", _("Snap vertices"), threshs[i]);
 	    break;
 	case (TOOL_RMDAC):
-	    G_message("%s: %13e", _("Remove duplicate area centroids"),
+	    G_message("%s: %.15g", _("Remove duplicate area centroids"),
 		      threshs[i]);
 	    break;
 	case (TOOL_BPOL):
-	    G_message("%s: %13e", _("Break polygons"), threshs[i]);
+	    G_message("%s: %.15g", _("Break polygons"), threshs[i]);
 	    break;
 	case (TOOL_PRUNE):
-	    G_message("%s: %13e", _("Prune"), threshs[i]);
+	    G_message("%s: %.15g", _("Prune"), threshs[i]);
 	    break;
 	case (TOOL_RMAREA):
-	    G_message("%s: %13e", _("Remove small areas"), threshs[i]);
+	    G_message("%s: %.15g", _("Remove small areas"), threshs[i]);
 	    break;
 	case (TOOL_RMSA):
-	    G_message("%s: %13e", _("Remove small angles at nodes"),
+	    G_message("%s: %.15g", _("Remove small angles at nodes"),
 		      threshs[i]);
 	    break;
 	case (TOOL_RMLINE):
-	    G_message("%s: %13e",
+	    G_message("%s: %.15g",
 		      _("Remove all lines or boundaries of zero length"),
 		      threshs[i]);
 	    break;

+ 4 - 3
vector/v.clean/split.c

@@ -49,8 +49,9 @@ int split_lines(struct Map_info *Map, int otype, struct Map_info *Err)
     area_size = sqrt((box.E - box.W) * (box.N - box.S));
 
     split_distance = area_size / log(n_split_lines);
-    /* divisor is the handle: increase divisor to decrease split_distance */
-    split_distance = split_distance / 10.;
+    /* divisor is the handle: increase divisor to decrease split_distance
+     * see also v.in.ogr */
+    split_distance = split_distance / 16.;
     G_debug(1, "area size: %f", area_size);
     G_debug(1, "split distance: %f", split_distance);
 
@@ -102,7 +103,7 @@ int split_line(struct Map_info *Map, int otype, struct line_pnts *Points,
 
     /* can't split boundaries with only 2 vertices */
     if (Points->n_points == 2) {
-	Vect_write_line(Map, otype, Points, Cats);
+	/* Vect_write_line(Map, otype, Points, Cats); */
 	return 0;
     }