mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix resolution of bound crs proj strings to auth/code
This commit is contained in:
parent
eafd7872dd
commit
c52b1d7785
@ -848,6 +848,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
|
||||
{
|
||||
// prefer EPSG codes for compatibility with earlier qgis conversions
|
||||
QgsProjUtils::proj_pj_unique_ptr candidateCrs( proj_list_get( QgsProjContext::get(), crsList, i ) );
|
||||
candidateCrs = QgsProjUtils::crsToSingleCrs( candidateCrs.get() );
|
||||
const QString authName( proj_get_id_auth_name( candidateCrs.get(), 0 ) );
|
||||
if ( confidence[i] > bestConfidence || authName == QLatin1String( "EPSG" ) )
|
||||
{
|
||||
|
@ -523,6 +523,10 @@ void TestQgsCoordinateReferenceSystem::fromProj4()
|
||||
QCOMPARE( myCrs.srsid(), GEOCRS_ID );
|
||||
myCrs = QgsCoordinateReferenceSystem::fromProj4( QString() );
|
||||
QVERIFY( !myCrs.isValid() );
|
||||
|
||||
|
||||
myCrs = QgsCoordinateReferenceSystem::fromProj4( "+proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-143,-90,-294,0,0,0,0 +units=m +no_defs" );
|
||||
QCOMPARE( myCrs.authid(), QStringLiteral( "EPSG:20936" ) );
|
||||
}
|
||||
|
||||
void TestQgsCoordinateReferenceSystem::proj4Cache()
|
||||
|
Loading…
x
Reference in New Issue
Block a user