Skip to content

Commit

Permalink
Fix #3596
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15481 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mmassing committed Mar 14, 2011
1 parent 30bb55a commit c54b8e5
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
Expand All @@ -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();
Expand Down

0 comments on commit c54b8e5

Please sign in to comment.