浏览代码

v.what.rast: better treat points on region boundary, see http://lists.osgeo.org/pipermail/grass-dev/2014-October/071158.html (Glynn)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62254 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 年之前
父节点
当前提交
6eb86161cc
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      vector/v.what.rast/main.c

+ 2 - 0
vector/v.what.rast/main.c

@@ -220,6 +220,8 @@ int main(int argc, char *argv[])
 	/* Add point to cache */
 	/* Add point to cache */
 	row = Rast_northing_to_row(Points->y[0], &window);
 	row = Rast_northing_to_row(Points->y[0], &window);
 	col = Rast_easting_to_col(Points->x[0], &window);
 	col = Rast_easting_to_col(Points->x[0], &window);
+	if (col < 0 || col >= window.cols || row < 0 || row >= window.rows)
+	   continue;
 
 
 	cache[point_cnt].row = row;
 	cache[point_cnt].row = row;
 	cache[point_cnt].col = col;
 	cache[point_cnt].col = col;