[GRASS-SVN] r43485 - grass/trunk/raster/r.resamp.bspline

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 17 08:57:28 EDT 2010


Author: mmetz
Date: 2010-09-17 12:57:28 +0000 (Fri, 17 Sep 2010)
New Revision: 43485

Modified:
   grass/trunk/raster/r.resamp.bspline/crosscorr.c
   grass/trunk/raster/r.resamp.bspline/main.c
Log:
fine-tune masking option

Modified: grass/trunk/raster/r.resamp.bspline/crosscorr.c
===================================================================
--- grass/trunk/raster/r.resamp.bspline/crosscorr.c	2010-09-17 12:56:40 UTC (rev 43484)
+++ grass/trunk/raster/r.resamp.bspline/crosscorr.c	2010-09-17 12:57:28 UTC (rev 43485)
@@ -164,7 +164,7 @@
     /*Cats = Vect_new_cats_struct (); */
 
     /* Current region is read and points recorded into observ */
-    observ = P_Read_Raster_Region_Map(matrix, &region, src_reg, &ndata, &nnulls, 1024);
+    observ = P_Read_Raster_Region_Map(matrix, NULL, &region, src_reg, &ndata, &nnulls, 1024);
     G_debug(5, "CrossCorrelation: %d points read in region. ", ndata);
     G_verbose_message(_("%d points read in region"),
 		      ndata);

Modified: grass/trunk/raster/r.resamp.bspline/main.c
===================================================================
--- grass/trunk/raster/r.resamp.bspline/main.c	2010-09-17 12:56:40 UTC (rev 43484)
+++ grass/trunk/raster/r.resamp.bspline/main.c	2010-09-17 12:57:28 UTC (rev 43485)
@@ -504,7 +504,7 @@
 	    dim_vect = nsplx * nsply;
 
 	    observ =
-		P_Read_Raster_Region_Map(inrast_matrix, &elaboration_reg,
+		P_Read_Raster_Region_Map(inrast_matrix, mask_matrix, &elaboration_reg,
 		                         &src_reg, &npoints, &n_nulls,
 					 dim_vect);
 
@@ -523,24 +523,25 @@
 		    subregion_row, subregion_col, mean);
 
 	    observ_null = NULL;
-	    if (null_flag->answer) {
-		if (n_nulls) {
-		    /* read input NULL cells */
+	    if (null_flag->answer && n_nulls) {
+		/* read input NULL cells */
 
-		    G_debug(1, "read input NULL cells");
+		G_debug(1, "read input NULL cells");
 
-		    observ_null =
-			P_Read_Raster_Region_Nulls(inrast_matrix, mask_matrix, &src_reg,
-			                         dest_box, general_box,
-						 &npoints_null, dim_vect, mean);
+		observ_null =
+		    P_Read_Raster_Region_Nulls(inrast_matrix, mask_matrix, &src_reg,
+					     dest_box, general_box,
+					     &npoints_null, dim_vect, mean);
 
-		    G_debug(1, "%d nulls in elaboration, %d nulls in general", n_nulls, npoints_null);
-		    if (npoints_null == 0) {
-			G_free(observ_null);
-			n_nulls = 0;
-		    }
+		G_debug(1, "%d nulls in elaboration, %d nulls in general", n_nulls, npoints_null);
+		if (npoints_null == 0) {
+		    G_free(observ_null);
+		    n_nulls = 0;
 		}
 	    }
+	    else if (npoints == 0 && n_nulls == 0)
+		/* nothing to interpolate, disable warning below */
+		npoints = 1;
 	    else
 		n_nulls = 1;
 



More information about the grass-commit mailing list