Skip to content

Commit

Permalink
Expand GNSS and CORS acroynms in proj scope text
Browse files Browse the repository at this point in the history
(I'm sure I'm not the only one who continually reads CORS as
"Cross-origin resource sharing"!)
  • Loading branch information
nyalldawson committed Sep 17, 2019
1 parent bbaa62a commit 6761617
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/gui/qgsdatumtransformdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void QgsDatumTransformDialog::load( QPair<int, int> selectedDatumTransforms, con
QString text;
if ( !singleOpDetails.scope.isEmpty() )
{
text += QStringLiteral( "<b>%1</b>: %2" ).arg( tr( "Scope" ), singleOpDetails.scope );
text += QStringLiteral( "<b>%1</b>: %2" ).arg( tr( "Scope" ), formatScope( singleOpDetails.scope ) );
}
if ( !singleOpDetails.remarks.isEmpty() )
{
Expand Down Expand Up @@ -688,6 +688,19 @@ void QgsDatumTransformDialog::applyDefaultTransform()
}
}

QString QgsDatumTransformDialog::formatScope( const QString &s )
{
QString scope = s;

QRegularExpression reGNSS( QStringLiteral( "\\bGNSS\\b" ) );
scope.replace( reGNSS, QObject::tr( "GNSS (Global Navigation Satellite System)" ) );

QRegularExpression reCORS( QStringLiteral( "\\bCORS\\b" ) );
scope.replace( reCORS, QObject::tr( "CORS (Continually Operating Reference Station)" ) );

return scope;
}

QgsDatumTransformDialog::TransformInfo QgsDatumTransformDialog::selectedDatumTransform()
{
int row = mDatumTransformTableWidget->currentRow();
Expand Down
5 changes: 5 additions & 0 deletions src/gui/qgsdatumtransformdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ class GUI_EXPORT QgsDatumTransformDialog : public QDialog, private Ui::QgsDatumT
*/
void applyDefaultTransform();

/**
* Cleans up a PROJ scope string, adding friendly acronym descriptions.
*/
QString formatScope( const QString &scope );

#if PROJ_VERSION_MAJOR>=6
QList< QgsDatumTransform::TransformDetails > mDatumTransforms;
#else
Expand Down

0 comments on commit 6761617

Please sign in to comment.