Skip to content

Commit

Permalink
Make custom projection validation button work on proj < 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 17, 2019
1 parent 84af693 commit 30b2919
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -515,7 +515,23 @@ void QgsCustomProjectionDialog::validateCurrent()
proj_log_func( context, nullptr, nullptr ); proj_log_func( context, nullptr, nullptr );
proj_context_destroy( context ); proj_context_destroy( context );
context = nullptr; context = nullptr;
#else
projCtx pContext = pj_ctx_alloc();
projPJ proj = pj_init_plus_ctx( pContext, projDef.toLocal8Bit().data() );


if ( proj )
{
QMessageBox::information( this, tr( "Custom Coordinate Reference System" ),
tr( "This proj projection definition is valid." ) );
}
else
{
QMessageBox::warning( this, tr( "Custom Coordinate Reference System" ),
tr( "This proj projection definition is not valid" ) );
}

pj_free( proj );
pj_ctx_free( pContext );
#endif #endif
} }


Expand Down

0 comments on commit 30b2919

Please sign in to comment.