浏览代码

Update main.c

r.slope.aspect: correct rounding of aspect for negative numbers
Markus Metz 5 年之前
父节点
当前提交
fdd079c3b9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      raster/r.slope.aspect/main.c

+ 1 - 1
raster/r.slope.aspect/main.c

@@ -811,7 +811,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE) {
 		    if (aspect > 0 && aspect < 0.5)
 			aspect = 360;
-		    *((CELL *) asp_ptr) = (CELL) (aspect + .5);
+		    *((CELL *) asp_ptr) = (CELL) floor(aspect + .5);
 		}
 		else
 		    Rast_set_d_value(asp_ptr,