Skip to content
Permalink
Browse files
Merge pull request #3056 from rouault/gdal_make_autowarpedvrt_for_rpc
[GDAL provider] Use GDALAutoCreateWarpedVRT() when the dataset has only RPC
  • Loading branch information
nyalldawson committed May 10, 2016
2 parents 0f6838d + 75cfb32 commit 21c6486
Showing 1 changed file with 12 additions and 2 deletions.
@@ -2503,7 +2503,8 @@ void QgsGdalProvider::initBaseDataset()
|| mGeoTransform[2] != 0.0
|| mGeoTransform[4] != 0.0
|| mGeoTransform[5] > 0.0 ) )
|| GDALGetGCPCount( mGdalBaseDataset ) > 0 )
|| GDALGetGCPCount( mGdalBaseDataset ) > 0
|| GDALGetMetadata( mGdalBaseDataset, "RPC" ) )
{
QgsLogger::warning( "Creating Warped VRT." );

@@ -2580,7 +2581,16 @@ void QgsGdalProvider::initBaseDataset()
if ( !crsFromWkt( GDALGetProjectionRef( 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

0 comments on commit 21c6486

Please sign in to comment.