Jelajahi Sumber

rstlib: fix mask and region (https://trac.osgeo.org/grass/ticket/1775)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@59738 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 11 tahun lalu
induk
melakukan
f655cec15d
2 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 6 1
      lib/rst/interp_float/input2d.c
  2. 1 1
      lib/rst/interp_float/resout2d.c

+ 6 - 1
lib/rst/interp_float/input2d.c

@@ -29,7 +29,7 @@ struct BM *IL_create_bitmask(struct interp_params *params)
 
 /** Creates a bitmap mask from given raster map **/
 {
-    int i, j, cfmask = 0, irev, MASKfd;
+    int i, j, cfmask = -1, irev, MASKfd;
     const char *mapsetm;
     CELL *cellmask, *MASK;
     struct BM *bitmask;
@@ -71,6 +71,11 @@ struct BM *IL_create_bitmask(struct interp_params *params)
     }
     else
 	bitmask = NULL;
+    
+    if (MASKfd >= 0)
+	Rast_close(MASKfd);
+    if (cfmask >= 0)
+	Rast_close(cfmask);
 
     return bitmask;
 }

+ 1 - 1
lib/rst/interp_float/resout2d.c

@@ -78,7 +78,7 @@ int IL_resample_output_2d(struct interp_params *params, double zmin, double zmax
     Rast_set_output_window(outhd);
     mapset = G_mapset();
 
-    cell1 = Rast_allocate_f_buf();
+    cell1 = Rast_allocate_f_output_buf();
 
     if (params->elev)
 	cf1 = Rast_open_fp_new(params->elev);