Skip to content
Permalink
Browse files

[GRASS] suppress raster masking for rendering and querying

  • Loading branch information
blazek committed Dec 15, 2015
1 parent 4f2da48 commit e7a0167189d98045e17fed853cefd311af1a7fc8
Showing with 9 additions and 2 deletions.
  1. +3 −0 src/providers/grass/qgis.d.rast.c
  2. +3 −1 src/providers/grass/qgis.g.info.c
  3. +3 −1 src/providers/grass/qgsgrass.cpp
@@ -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 );
@@ -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 );
@@ -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 )
@@ -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 );
@@ -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 )
@@ -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();
@@ -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

0 comments on commit e7a0167

Please sign in to comment.
You can’t perform that action at this time.