Skip to content

Commit 21c6486

Browse files
committedMay 10, 2016
Merge pull request #3056 from rouault/gdal_make_autowarpedvrt_for_rpc
[GDAL provider] Use GDALAutoCreateWarpedVRT() when the dataset has only RPC
2 parents 0f6838d + 75cfb32 commit 21c6486

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,8 @@ void QgsGdalProvider::initBaseDataset()
25032503
|| mGeoTransform[2] != 0.0
25042504
|| mGeoTransform[4] != 0.0
25052505
|| mGeoTransform[5] > 0.0 ) )
2506-
|| GDALGetGCPCount( mGdalBaseDataset ) > 0 )
2506+
|| GDALGetGCPCount( mGdalBaseDataset ) > 0
2507+
|| GDALGetMetadata( mGdalBaseDataset, "RPC" ) )
25072508
{
25082509
QgsLogger::warning( "Creating Warped VRT." );
25092510

@@ -2580,7 +2581,16 @@ void QgsGdalProvider::initBaseDataset()
25802581
if ( !crsFromWkt( GDALGetProjectionRef( mGdalDataset ) ) &&
25812582
!crsFromWkt( GDALGetGCPProjection( mGdalDataset ) ) )
25822583
{
2583-
QgsDebugMsg( "No valid CRS identified" );
2584+
if ( mGdalBaseDataset != mGdalDataset &&
2585+
GDALGetMetadata( mGdalBaseDataset, "RPC" ) )
2586+
{
2587+
// Warped VRT of RPC is in EPSG:4326
2588+
mCrs.createFromOgcWmsCrs( "EPSG:4326" );
2589+
}
2590+
else
2591+
{
2592+
QgsDebugMsg( "No valid CRS identified" );
2593+
}
25842594
}
25852595

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

0 commit comments

Comments
 (0)
Please sign in to comment.