Skip to content

Commit

Permalink
read window from map
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@13064 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 16, 2010
1 parent 72c7dd0 commit 74141c9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/providers/grass/qgis.d.rast.c
Expand Up @@ -54,7 +54,15 @@ int main( int argc, char **argv )

name = map->answer;

G_get_window( &window );
/* Make sure map is available */
mapset = G_find_cell2( name, "" );
if ( mapset == NULL )
G_fatal_error(( "Raster map <%s> not found" ), name );

/* It can happen that GRASS data set is 'corrupted' and zone differs in WIND and
* cellhd, and G_open_cell_old fails, so it is better to read window from map */
/* G_get_window( &window ); */
G_get_cellhd( name, mapset, &window );
window.west = atof( win->answers[0] );
window.south = atof( win->answers[1] );
window.east = atof( win->answers[2] );
Expand All @@ -64,12 +72,6 @@ int main( int argc, char **argv )
G_adjust_Cell_head( &window, 1, 1 );
G_set_window( &window );

/* Make sure map is available */
mapset = G_find_cell2( name, "" );
if ( mapset == NULL )
G_fatal_error(( "Raster map <%s> not found" ), name );


fp = G_raster_map_is_fp( name, mapset );

/* use DCELL even if the map is FCELL */
Expand Down

0 comments on commit 74141c9

Please sign in to comment.