Skip to content

Commit 8391d1a

Browse files
author
jef
committed
fix #3602
git-svn-id: http://svn.osgeo.org/qgis/trunk@15465 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9cca04d commit 8391d1a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/plugins/grass/qgsgrassnewmapset.cpp

+5-11
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,11 @@ void QgsGrassNewMapset::setGrassProjection()
433433
}
434434
else
435435
{
436-
#ifdef QGISDEBUG
436+
char *wkt = NULL;
437+
437438
QgsDebugMsg( QString( "OSRIsGeographic = %1" ).arg( OSRIsGeographic( hCRS ) ) );
438439
QgsDebugMsg( QString( "OSRIsProjected = %1" ).arg( OSRIsProjected( hCRS ) ) );
439440

440-
char *wkt = NULL;
441441
if (( errcode = OSRExportToWkt( hCRS, &wkt ) ) != OGRERR_NONE )
442442
{
443443
QgsDebugMsg( QString( "OGR can't get Wkt-style parameter string\nOGR Error code was %1" ).arg( errcode ) );
@@ -446,27 +446,21 @@ void QgsGrassNewMapset::setGrassProjection()
446446
{
447447
QgsDebugMsg( QString( "wkt = %1" ).arg( wkt ) );
448448
}
449-
#endif
450449

451450
int ret;
452451
// Note: GPJ_osr_to_grass() defaults in PROJECTION_XY if projection
453452
// cannot be set
454453

455454
// There was a bug in GRASS, it is present in 6.0.x line
456-
#if GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 1
457-
ret = GPJ_osr_to_grass( &mCellHead, &mProjInfo,
458-
&mProjUnits, hCRS, 0 );
459-
#else
460-
// Buggy version:
461-
ret = GPJ_osr_to_grass( &mCellHead, &mProjInfo,
462-
&mProjUnits, ( void ** )hCRS, 0 );
463-
#endif
455+
ret = GPJ_wkt_to_grass( &mCellHead, &mProjInfo, &mProjUnits, wkt, 0 );
464456

465457
// Note: It seems that GPJ_osr_to_grass()returns always 1,
466458
// -> test if mProjInfo was set
467459

468460
QgsDebugMsg( QString( "ret = %1" ).arg( ret ) );
469461
QgsDebugMsg( QString( "mProjInfo = %1" ).arg( QString::number(( qulonglong )mProjInfo, 16 ).toLocal8Bit().constData() ) );
462+
463+
OGRFree( wkt );
470464
}
471465

472466
if ( !mProjInfo || !mProjUnits )

0 commit comments

Comments
 (0)