Skip to content

Commit 73483c4

Browse files
author
rblazek
committed
read window from map
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13064 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 11bf923 commit 73483c4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

+9-7
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ int main( int argc, char **argv )
5454

5555
name = map->answer;
5656

57-
G_get_window( &window );
57+
/* Make sure map is available */
58+
mapset = G_find_cell2( name, "" );
59+
if ( mapset == NULL )
60+
G_fatal_error(( "Raster map <%s> not found" ), name );
61+
62+
/* It can happen that GRASS data set is 'corrupted' and zone differs in WIND and
63+
* cellhd, and G_open_cell_old fails, so it is better to read window from map */
64+
/* G_get_window( &window ); */
65+
G_get_cellhd( name, mapset, &window );
5866
window.west = atof( win->answers[0] );
5967
window.south = atof( win->answers[1] );
6068
window.east = atof( win->answers[2] );
@@ -64,12 +72,6 @@ int main( int argc, char **argv )
6472
G_adjust_Cell_head( &window, 1, 1 );
6573
G_set_window( &window );
6674

67-
/* Make sure map is available */
68-
mapset = G_find_cell2( name, "" );
69-
if ( mapset == NULL )
70-
G_fatal_error(( "Raster map <%s> not found" ), name );
71-
72-
7375
fp = G_raster_map_is_fp( name, mapset );
7476

7577
/* use DCELL even if the map is FCELL */

0 commit comments

Comments
 (0)