浏览代码

version update for cherry-pick of 285356892

byronbest 5 年之前
父节点
当前提交
33fdda72e2
共有 2 个文件被更改,包括 36 次插入4 次删除
  1. 4 4
      README.md
  2. 32 0
      raster/r.to.vect/lines.c

+ 4 - 4
README.md

@@ -72,11 +72,11 @@ A test run (assuming you have existing GRASS GIS location; it can be downloaded
 ```
 # case 1: launching in the grassdata directory in which the location is stored:
 docker run -it --rm --user=$(id -u):$(id -g) --volume $(pwd):/data --env HOME=/data/ grassgis78 \
-    grass --text nc_spm_08_grass7/user1 --exec g.region -p
+    grass --text nc_basic_spm_grass7/user1 --exec g.region -p
 
 # case 2: launching anywhere
 docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ grassgis78 \
-    grass /data/nc_basic_spm/PERMANENT --exec g.region -p
+    grass /data/nc_basic_spm_grass7/PERMANENT --exec g.region -p
 ```
 
 Note that the first `grassgis78` is the name of the image while the second
@@ -86,9 +86,9 @@ To run the tests (again assuming local location):
 
 ```
     docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ -w /code/grass \
-        grassgis78 grass /data/nc_basic_spm/PERMANENT --exec \
+        grassgis78 grass /data/nc_basic_spm_grass7/PERMANENT --exec \
             python -m grass.gunittest.main \
-                --location nc_basic_spm --location-type nc
+                --location nc_basic_spm_grass7 --location-type nc
 ```
 
 Note: If you compiled locally before building the Docker image, you may

+ 32 - 0
raster/r.to.vect/lines.c

@@ -244,10 +244,42 @@ static int update_list(int count)
 	break;
     case 2:			/* straight or bent line */
 	if (tl != 0 && br != 0) {	/* slanted line (\) */
+		if (value_flag) {
+			/* only CELL supported */
+			if (data_type == CELL_TYPE) {
+				int mc_val = ((CELL *) middle)[col];
+				int br_val = ((CELL *) bottom)[col + 1];
+				int tl_val = ((CELL *) top)[col - 1];
+				if (tl_val != mc_val) {
+					v_list[col].left = end_line(v_list[col].left, 1);
+					v_list[col].left = start_line(0);
+				}
+				if (mc_val != br_val) {
+					v_list[col].left = end_line(v_list[col].left, 1);
+					v_list[col].left = start_line(0);
+				}
+			}
+		}
 	    v_list[col + 1].left = v_list[col].left;
 	    v_list[col].left = NULL;
 	}
 	else if (tr != 0 && bl != 0) {	/* slanted line (/) */
+		if (value_flag) {
+			/* only CELL supported */
+			if (data_type == CELL_TYPE) {
+				int mc_val = ((CELL *) middle)[col];
+				int bl_val = ((CELL *) bottom)[col - 1];
+				int tr_val = ((CELL *) top)[col + 1];
+				if (tr_val != mc_val) {
+					v_list[col].right = end_line(v_list[col].right, 1);
+					v_list[col].right = start_line(0);
+				}
+				if (mc_val != bl_val) {
+					v_list[col].right = end_line(v_list[col].right, 1);
+					v_list[col].right = start_line(0);
+				}
+			}
+		}
 	    v_list[col - 1].right = v_list[col].right;
 	    v_list[col].right = NULL;
 	}