Skip to content

Commit

Permalink
[GRASS] suppress raster masking for rendering and querying
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Dec 15, 2015
1 parent 4f2da48 commit e7a0167
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/providers/grass/qgis.d.rast.c
Expand Up @@ -60,6 +60,7 @@
#define G_read_colors Rast_read_colors
#define G_window_cols Rast_window_cols
#define G_window_rows Rast_window_rows
#define G_suppress_masking Rast_suppress_masking
#endif

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

G_suppress_masking(); // must be after G_set_window()

raster_type = G_raster_map_type( name, "" );

display( name, mapset, raster_type, format->answer );
Expand Down
4 changes: 3 additions & 1 deletion src/providers/grass/qgis.g.info.c
Expand Up @@ -54,6 +54,7 @@
#define G_read_fp_range Rast_read_fp_range
#define G_window_cols Rast_window_cols
#define G_window_rows Rast_window_rows
#define G_suppress_masking Rast_suppress_masking
#endif

int main( int argc, char **argv )
Expand Down Expand Up @@ -114,7 +115,6 @@ int main( int argc, char **argv )
if ( G_parser( argc, argv ) )
exit( EXIT_FAILURE );


if ( strcmp( "proj", info_opt->answer ) == 0 )
{
G_get_window( &window );
Expand Down Expand Up @@ -211,6 +211,7 @@ int main( int argc, char **argv )
char buff[101];
G_get_cellhd( rast_opt->answer, "", &window );
G_set_window( &window );
G_suppress_masking(); // must be after G_set_window()
fd = G_open_cell_old( rast_opt->answer, "" );
// wait for coords from stdin
while ( fgets( buff, 100, stdin ) != 0 )
Expand Down Expand Up @@ -323,6 +324,7 @@ int main( int argc, char **argv )
window.cols = ( int ) atoi( cols_opt->answer );

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

ncols = G_window_cols();
Expand Down
4 changes: 3 additions & 1 deletion src/providers/grass/qgsgrass.cpp
Expand Up @@ -368,9 +368,11 @@ bool QgsGrass::init( void )
return false;
}

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

0 comments on commit e7a0167

Please sign in to comment.