[QGIS Commit] r13064 - trunk/qgis/src/providers/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Mar 16 17:42:30 EDT 2010


Author: rblazek
Date: 2010-03-16 17:42:28 -0400 (Tue, 16 Mar 2010)
New Revision: 13064

Modified:
   trunk/qgis/src/providers/grass/qgis.d.rast.c
Log:
read window from map

Modified: trunk/qgis/src/providers/grass/qgis.d.rast.c
===================================================================
--- trunk/qgis/src/providers/grass/qgis.d.rast.c	2010-03-16 12:59:32 UTC (rev 13063)
+++ trunk/qgis/src/providers/grass/qgis.d.rast.c	2010-03-16 21:42:28 UTC (rev 13064)
@@ -54,7 +54,15 @@
 
   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] );
@@ -64,12 +72,6 @@
   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 */



More information about the QGIS-commit mailing list