Quellcode durchsuchen

v.edit: type=boundary defines SF Polygon type

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48174 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa vor 13 Jahren
Ursprung
Commit
7cd50740e8
2 geänderte Dateien mit 8 neuen und 4 gelöschten Zeilen
  1. 1 0
      vector/v.edit/args.c
  2. 7 4
      vector/v.edit/main.c

+ 1 - 0
vector/v.edit/args.c

@@ -22,6 +22,7 @@ int parser(int argc, char *argv[], struct GParams *params,
     params->fld->guisection = _("Selection");
 
     params->type = G_define_standard_option(G_OPT_V_TYPE);
+    params->type->options = "point,line,boundary,centroid";
     params->type->guisection = _("Selection");
 
     params->tool = G_define_option();

+ 7 - 4
vector/v.edit/main.c

@@ -96,9 +96,9 @@ int main(int argc, char *argv[])
 	    int type;
 	    type = Vect_option_to_types(params.type);
 	    if (type != GV_POINT && type != GV_LINE &&
-		type != GV_AREA)
+		type != GV_BOUNDARY)
 		G_fatal_error(_("Supported feature type for OGR layer: "
-				"%s, %s or %s"), "point", "line", "area");
+				"%s, %s or %s"), "point", "line", "boundary");
 	    V2_open_new_ogr(&Map, type);
 	}
 	if (ret == -1) {
@@ -260,8 +260,11 @@ int main(int argc, char *argv[])
 	    
 	    G_verbose_message(_("Threshold value for snapping is %.2f"),
 			      thresh[THRESH_SNAP]);
-	    if (snap != NO_SNAP) {	/* apply snapping */
-		Vedit_snap_lines(&Map, BgMap, nbgmaps, List_added, thresh[THRESH_SNAP], snap == SNAP ? 0 : 1);	/* snap to vertex ? */
+	    if (snap != NO_SNAP) { /* apply snapping */
+		/* snap to vertex ? */
+		Vedit_snap_lines(&Map, BgMap, nbgmaps, List_added,
+				 thresh[THRESH_SNAP],
+				 snap == SNAP ? FALSE : TRUE); 
 	    }
 	    if (params.close->answer) {	/* close boundaries */
 		int nclosed;