Skip to content
Permalink
Browse files

Fix #3596

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15481 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mmassing
mmassing committed Mar 14, 2011
1 parent 30bb55a commit c54b8e5038a597b039addb3bec320acdf34d7568
Showing with 18 additions and 2 deletions.
  1. +18 −2 src/providers/gdal/qgsgdalprovider.cpp
@@ -143,9 +143,11 @@ QgsGdalProvider::QgsGdalProvider( QString const & uri )
mMinimum.append( 0 );
mMaximum.append( 0 );
}

// Check if we need a warped VRT for this file.
if (( GDALGetGeoTransform( mGdalBaseDataset, mGeoTransform ) == CE_None
&& ( mGeoTransform[1] < 0.0
bool hasGeoTransform = GDALGetGeoTransform( mGdalBaseDataset, mGeoTransform ) == CE_None;
if ( ( hasGeoTransform
&& ( mGeoTransform[1] < 0.0
|| mGeoTransform[2] != 0.0
|| mGeoTransform[4] != 0.0
|| mGeoTransform[5] > 0.0 ) )
@@ -168,6 +170,20 @@ QgsGdalProvider::QgsGdalProvider( QString const & uri )
mGdalDataset = mGdalBaseDataset;
GDALReferenceDataset( mGdalDataset );
}

if (!hasGeoTransform)
{
mWidth = GDALGetRasterXSize( mGdalDataset );
mHeight = GDALGetRasterYSize( mGdalDataset );

// Initialise the affine transform matrix
mGeoTransform[0] = 0;
mGeoTransform[1] = 1;
mGeoTransform[2] = 0;
mGeoTransform[3] = 0;
mGeoTransform[4] = 0;
mGeoTransform[5] = -1;
}

//check if this file has pyramids
CPLErrorReset();

0 comments on commit c54b8e5

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