Skip to content

Commit e7a0167

Browse files
committed
[GRASS] suppress raster masking for rendering and querying
1 parent 4f2da48 commit e7a0167

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/providers/grass/qgis.d.rast.c

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#define G_read_colors Rast_read_colors
6161
#define G_window_cols Rast_window_cols
6262
#define G_window_rows Rast_window_rows
63+
#define G_suppress_masking Rast_suppress_masking
6364
#endif
6465

6566
int display( char *name, char *mapset, RASTER_MAP_TYPE data_type, char *format );
@@ -123,6 +124,8 @@ int main( int argc, char **argv )
123124
G_adjust_Cell_head( &window, 1, 1 );
124125
G_set_window( &window );
125126

127+
G_suppress_masking(); // must be after G_set_window()
128+
126129
raster_type = G_raster_map_type( name, "" );
127130

128131
display( name, mapset, raster_type, format->answer );

src/providers/grass/qgis.g.info.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#define G_read_fp_range Rast_read_fp_range
5555
#define G_window_cols Rast_window_cols
5656
#define G_window_rows Rast_window_rows
57+
#define G_suppress_masking Rast_suppress_masking
5758
#endif
5859

5960
int main( int argc, char **argv )
@@ -114,7 +115,6 @@ int main( int argc, char **argv )
114115
if ( G_parser( argc, argv ) )
115116
exit( EXIT_FAILURE );
116117

117-
118118
if ( strcmp( "proj", info_opt->answer ) == 0 )
119119
{
120120
G_get_window( &window );
@@ -211,6 +211,7 @@ int main( int argc, char **argv )
211211
char buff[101];
212212
G_get_cellhd( rast_opt->answer, "", &window );
213213
G_set_window( &window );
214+
G_suppress_masking(); // must be after G_set_window()
214215
fd = G_open_cell_old( rast_opt->answer, "" );
215216
// wait for coords from stdin
216217
while ( fgets( buff, 100, stdin ) != 0 )
@@ -323,6 +324,7 @@ int main( int argc, char **argv )
323324
window.cols = ( int ) atoi( cols_opt->answer );
324325

325326
G_set_window( &window );
327+
G_suppress_masking(); // must be after G_set_window()
326328
fd = G_open_cell_old( rast_opt->answer, "" );
327329

328330
ncols = G_window_cols();

src/providers/grass/qgsgrass.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,11 @@ bool QgsGrass::init( void )
368368
return false;
369369
}
370370

371-
// I think that mask should not be used in QGIS as it can only confuses people,
371+
// I think that mask should not be used in QGIS as it can confuse users,
372372
// anyway, I don't think anybody is using MASK
373373
// TODO7: Rast_suppress_masking (see G_suppress_masking() macro above) needs MAPSET
374+
// (it should not be necessary, because rasters are read by modules qgis.g.info and qgis.d.rast
375+
// where masking is suppressed)
374376
#if GRASS_VERSION_MAJOR < 7
375377
G_suppress_masking();
376378
#endif

0 commit comments

Comments
 (0)