[GRASS-SVN] r54143 - grass/trunk/vector/v.what.rast
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 2 11:34:29 PST 2012
Author: mmetz
Date: 2012-12-02 11:34:29 -0800 (Sun, 02 Dec 2012)
New Revision: 54143
Modified:
grass/trunk/vector/v.what.rast/main.c
Log:
v.what.rast: remove nonsense special case handling
Modified: grass/trunk/vector/v.what.rast/main.c
===================================================================
--- grass/trunk/vector/v.what.rast/main.c 2012-12-02 15:34:58 UTC (rev 54142)
+++ grass/trunk/vector/v.what.rast/main.c 2012-12-02 19:34:29 UTC (rev 54143)
@@ -37,7 +37,7 @@
CELL *cell;
DCELL *dcell;
int width;
- double drow, dcol;
+ int row, col;
char buf[2000];
struct {
struct Option *vect, *rast, *field, *col, *where;
@@ -188,21 +188,11 @@
G_debug(4, " cat = %d", cat);
/* Add point to cache */
- drow = Rast_northing_to_row(Points->y[0], &window);
- dcol = Rast_easting_to_col(Points->x[0], &window);
+ row = Rast_northing_to_row(Points->y[0], &window);
+ col = Rast_easting_to_col(Points->x[0], &window);
- /* a special case.
- * if north falls at southern edge, or east falls on eastern edge,
- * the point will appear outside the window.
- * So, for these edges, bring the point inside the window
- */
- if (drow == window.rows)
- drow--;
- if (dcol == window.cols)
- dcol--;
-
- cache[point_cnt].row = (int)drow;
- cache[point_cnt].col = (int)dcol;
+ cache[point_cnt].row = row;
+ cache[point_cnt].col = col;
cache[point_cnt].cat = cat;
cache[point_cnt].count = 1;
point_cnt++;
More information about the grass-commit
mailing list