[QGIS Commit] r15367 - in branches/raster-providers/src: core/raster providers/gdal providers/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Mar 6 13:27:32 EST 2011


Author: rblazek
Date: 2011-03-06 10:27:31 -0800 (Sun, 06 Mar 2011)
New Revision: 15367

Modified:
   branches/raster-providers/src/core/raster/qgsrasterlayer.cpp
   branches/raster-providers/src/providers/gdal/qgsgdalprovider.cpp
   branches/raster-providers/src/providers/grass/qgsgrassrasterprovider.cpp
Log:
Zoom to best fix

Modified: branches/raster-providers/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- branches/raster-providers/src/core/raster/qgsrasterlayer.cpp	2011-03-06 17:49:40 UTC (rev 15366)
+++ branches/raster-providers/src/core/raster/qgsrasterlayer.cpp	2011-03-06 18:27:31 UTC (rev 15367)
@@ -2297,7 +2297,12 @@
 // We can only use one of the mGeoTransform[], so go with the
 // horisontal one.
 
-  return qAbs( mGeoTransform[1] );
+  //return qAbs( mGeoTransform[1] );
+  if ( mDataProvider->capabilities() & QgsRasterDataProvider::ExactResolution && mDataProvider->xSize() > 0 )
+  {
+    return mDataProvider->extent().width() / mDataProvider->xSize();
+  }
+  return 1;
 }
 
 

Modified: branches/raster-providers/src/providers/gdal/qgsgdalprovider.cpp
===================================================================
--- branches/raster-providers/src/providers/gdal/qgsgdalprovider.cpp	2011-03-06 17:49:40 UTC (rev 15366)
+++ branches/raster-providers/src/providers/gdal/qgsgdalprovider.cpp	2011-03-06 18:27:31 UTC (rev 15367)
@@ -928,6 +928,7 @@
 int QgsGdalProvider::capabilities() const
 {
   int capability = QgsRasterDataProvider::Identify 
+                | QgsRasterDataProvider::ExactResolution
                 | QgsRasterDataProvider::EstimatedMinimumMaximum
                 | QgsRasterDataProvider::BuildPyramids
                 | QgsRasterDataProvider::Histogram

Modified: branches/raster-providers/src/providers/grass/qgsgrassrasterprovider.cpp
===================================================================
--- branches/raster-providers/src/providers/grass/qgsgrassrasterprovider.cpp	2011-03-06 17:49:40 UTC (rev 15366)
+++ branches/raster-providers/src/providers/grass/qgsgrassrasterprovider.cpp	2011-03-06 18:27:31 UTC (rev 15367)
@@ -335,6 +335,7 @@
 int QgsGrassRasterProvider::capabilities() const
 {
   int capability = QgsRasterDataProvider::Identify 
+                | QgsRasterDataProvider::ExactResolution
                 | QgsRasterDataProvider::ExactMinimumMaximum
                 | QgsRasterDataProvider::Size;
   return capability;



More information about the QGIS-commit mailing list