Skip to content
Permalink
Browse files

Make custom projection validation button work on proj < 6

(cherry picked from commit 30b2919)
  • Loading branch information
nyalldawson committed Dec 16, 2019
1 parent 304f6f2 commit b2a8bcd9511feaeb2deb3a0d0f7934f4796fa8a4
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/app/qgscustomprojectiondialog.cpp
@@ -515,7 +515,23 @@ void QgsCustomProjectionDialog::validateCurrent()
proj_log_func( context, nullptr, nullptr );
proj_context_destroy( context );
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
}

0 comments on commit b2a8bcd

Please sign in to comment.
You can’t perform that action at this time.