Forráskód Böngészése

fix https://trac.osgeo.org/grass/changeset/48886

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48888 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 13 éve
szülő
commit
2550c70455
2 módosított fájl, 11 hozzáadás és 5 törlés
  1. 10 4
      lib/vector/Vlib/ascii.c
  2. 1 1
      lib/vector/Vlib/map.c

+ 10 - 4
lib/vector/Vlib/ascii.c

@@ -366,7 +366,6 @@ int Vect_write_ascii(FILE *ascii,
 
 
     line = 0;
     line = 0;
     while (TRUE) {
     while (TRUE) {
-	line++;
 	type = Vect_read_next_line(Map, Points, Cats);
 	type = Vect_read_next_line(Map, Points, Cats);
 	if (type == -1 ) {      /* failure */
 	if (type == -1 ) {      /* failure */
 	    if (columns) {
 	    if (columns) {
@@ -385,23 +384,30 @@ int Vect_write_ascii(FILE *ascii,
 	    break;
 	    break;
 	}
 	}
 
 
+	line++;
+
 	if (format == GV_ASCII_FORMAT_POINT && !(type & GV_POINTS))
 	if (format == GV_ASCII_FORMAT_POINT && !(type & GV_POINTS))
 	    continue;
 	    continue;
 
 
-	found = FALSE;
-	if (type == GV_BOUNDARY && Vect_level(Map) > 1) {
+	found = check_cat(ACats, Clist, cats, ncats);
+
+	if (!found && type == GV_BOUNDARY && Vect_level(Map) > 1) {
 	    Vect_get_line_areas(Map, line, &left, &right);
 	    Vect_get_line_areas(Map, line, &left, &right);
+	    if (left < 0)
+		left = Vect_get_isle_area(Map, abs(left));
 	    if (left > 0) {
 	    if (left > 0) {
 		Vect_get_area_cats(Map, left, ACats);
 		Vect_get_area_cats(Map, left, ACats);
 		found = check_cat(ACats, Clist, cats, ncats);
 		found = check_cat(ACats, Clist, cats, ncats);
 	    }
 	    }
+	    if (right < 0)
+		right = Vect_get_isle_area(Map, abs(right));
 	    if (!found && right > 0) {
 	    if (!found && right > 0) {
 		Vect_get_area_cats(Map, right, ACats);
 		Vect_get_area_cats(Map, right, ACats);
 		found = check_cat(ACats, Clist, cats, ncats);
 		found = check_cat(ACats, Clist, cats, ncats);
 	    }
 	    }
 	}
 	}
 	
 	
-	if (!found && !check_cat(Cats, Clist, cats, ncats))
+	if (!found)
 	    continue;
 	    continue;
 	
 	
 	if (ver < 5) {
 	if (ver < 5) {

+ 1 - 1
lib/vector/Vlib/map.c

@@ -182,7 +182,7 @@ static int copy_file(const char *src, const char *dst)
     if ((fd = open(src, O_RDONLY)) < 0)
     if ((fd = open(src, O_RDONLY)) < 0)
 	return 1;
 	return 1;
 
 
-    /* if((fd2 = open(dst, O_CREAT|O_TRUNC|O_WRONLY)) < 0) */
+    /* if((fd2 = open(dst, O_CREAT|O_TRUNC|O_WRONLY)) < 0) { */
     if ((f2 = fopen(dst, "w")) == NULL) {
     if ((f2 = fopen(dst, "w")) == NULL) {
 	close(fd);
 	close(fd);
 	return 1;
 	return 1;