Skip to content

Commit

Permalink
Don't show generic proj error message to users
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 3, 2019
1 parent 1241b3f commit a8b5583
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/qgscoordinatetransform_p.cpp
Expand Up @@ -336,13 +336,14 @@ ProjData QgsCoordinateTransformPrivate::threadLocalProjData()
if ( count < 1 )
{
// huh?
if ( int errNo = proj_context_errno( context ) )
int errNo = proj_context_errno( context );
if ( errNo && errNo != -61 )
{
nonAvailableError = QString( proj_errno_string( errNo ) );
}
else
{
nonAvailableError = QObject::tr( "No coordinate operations are available" );
nonAvailableError = QObject::tr( "No coordinate operations are available between these two reference systems" );
}
}
else if ( count == 1 )
Expand Down Expand Up @@ -439,13 +440,14 @@ ProjData QgsCoordinateTransformPrivate::threadLocalProjData()

if ( !transform && nonAvailableError.isEmpty() )
{
if ( int errNo = proj_context_errno( context ) )
int errNo = proj_context_errno( context );
if ( errNo && errNo != -61 )
{
nonAvailableError = QString( proj_errno_string( errNo ) );
}
else
{
nonAvailableError = QObject::tr( "No coordinate operations are available" );
nonAvailableError = QObject::tr( "No coordinate operations are available between these two reference systems" );
}
}

Expand All @@ -470,7 +472,7 @@ ProjData QgsCoordinateTransformPrivate::threadLocalProjData()
return nullptr;
}

// transform may have either the source or destination CRS using swapped axis order. For QGIS, we ALWAYS need regular x/y axis order
// transform may have either the source or destination CRS using swapped axis order. For QGIS, we ALWAYS need regular x/y axis order
ProjData res = proj_normalize_for_visualization( context, transform.get() );
mProjProjections.insert( reinterpret_cast< uintptr_t>( context ), res );

Expand Down

0 comments on commit a8b5583

Please sign in to comment.