[GRASS-dev] r.resample.interp also does not behave according to manual

Glynn Clements glynn at gclements.plus.com
Wed Sep 2 13:14:36 PDT 2015


Michael Barton wrote:

> g.region raster=ziqlab_region_resamp30m
> r.resamp.interp --overwrite input=Mediterranean_east_SRTM90m at PERMANENT output=ziqlab_region_resamp30m_test method=lanczos
> 
> ERROR: Reading raster map <Mediterranean_east_SRTM90m at PERMANENT>
> request for row 1216 is outside region

1. Does it happen with a method other than lanczos?

2. Does the following change fix it?

--- raster/r.resamp.interp/main.c	(revision 66085)
+++ raster/r.resamp.interp/main.c	(working copy)
@@ -111,11 +111,11 @@
 	double north = Rast_row_to_northing(0.5, &dst_w);
 	double south = Rast_row_to_northing(dst_w.rows - 0.5, &dst_w);
 	int r0 = (int)floor(Rast_northing_to_row(north, &src_w) - 0.5) - 2;
-	int r1 = (int)floor(Rast_northing_to_row(south, &src_w) - 0.5) + 3;
+	int r1 = (int)floor(Rast_northing_to_row(south, &src_w) - 0.5) + 4;
 	double west = Rast_col_to_easting(0.5, &dst_w);
 	double east = Rast_col_to_easting(dst_w.cols - 0.5, &dst_w);
 	int c0 = (int)floor(Rast_easting_to_col(west, &src_w) - 0.5) - 2;
-	int c1 = (int)floor(Rast_easting_to_col(east, &src_w) - 0.5) + 3;
+	int c1 = (int)floor(Rast_easting_to_col(east, &src_w) - 0.5) + 4;
 
 	src_w.south -= src_w.ns_res * (r1 - src_w.rows);
 	src_w.north += src_w.ns_res * (-r0);

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list