Skip to content

Commit

Permalink
[GDAL provider] Use GDALAutoCreateWarpedVRT() when the dataset has on…
Browse files Browse the repository at this point in the history
…ly RPC
  • Loading branch information
rouault committed May 3, 2016
1 parent 6173539 commit 75cfb32
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -2503,7 +2503,8 @@ void QgsGdalProvider::initBaseDataset()
|| mGeoTransform[2] != 0.0 || mGeoTransform[2] != 0.0
|| mGeoTransform[4] != 0.0 || mGeoTransform[4] != 0.0
|| mGeoTransform[5] > 0.0 ) ) || mGeoTransform[5] > 0.0 ) )
|| GDALGetGCPCount( mGdalBaseDataset ) > 0 ) || GDALGetGCPCount( mGdalBaseDataset ) > 0
|| GDALGetMetadata( mGdalBaseDataset, "RPC" ) )
{ {
QgsLogger::warning( "Creating Warped VRT." ); QgsLogger::warning( "Creating Warped VRT." );


Expand Down Expand Up @@ -2580,7 +2581,16 @@ void QgsGdalProvider::initBaseDataset()
if ( !crsFromWkt( GDALGetProjectionRef( mGdalDataset ) ) && if ( !crsFromWkt( GDALGetProjectionRef( mGdalDataset ) ) &&
!crsFromWkt( GDALGetGCPProjection( mGdalDataset ) ) ) !crsFromWkt( GDALGetGCPProjection( mGdalDataset ) ) )
{ {
QgsDebugMsg( "No valid CRS identified" ); if ( mGdalBaseDataset != mGdalDataset &&
GDALGetMetadata( mGdalBaseDataset, "RPC" ) )
{
// Warped VRT of RPC is in EPSG:4326
mCrs.createFromOgcWmsCrs( "EPSG:4326" );
}
else
{
QgsDebugMsg( "No valid CRS identified" );
}
} }


//set up the coordinat transform - in the case of raster this is mainly used to convert //set up the coordinat transform - in the case of raster this is mainly used to convert
Expand Down

0 comments on commit 75cfb32

Please sign in to comment.