Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #3602
git-svn-id: http://svn.osgeo.org/qgis/trunk@15465 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 13, 2011
1 parent 9cca04d commit 8391d1a
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/plugins/grass/qgsgrassnewmapset.cpp
Expand Up @@ -433,11 +433,11 @@ void QgsGrassNewMapset::setGrassProjection()
}
else
{
#ifdef QGISDEBUG
char *wkt = NULL;

QgsDebugMsg( QString( "OSRIsGeographic = %1" ).arg( OSRIsGeographic( hCRS ) ) );
QgsDebugMsg( QString( "OSRIsProjected = %1" ).arg( OSRIsProjected( hCRS ) ) );

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

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

// There was a bug in GRASS, it is present in 6.0.x line
#if GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 1
ret = GPJ_osr_to_grass( &mCellHead, &mProjInfo,
&mProjUnits, hCRS, 0 );
#else
// Buggy version:
ret = GPJ_osr_to_grass( &mCellHead, &mProjInfo,
&mProjUnits, ( void ** )hCRS, 0 );
#endif
ret = GPJ_wkt_to_grass( &mCellHead, &mProjInfo, &mProjUnits, wkt, 0 );

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

QgsDebugMsg( QString( "ret = %1" ).arg( ret ) );
QgsDebugMsg( QString( "mProjInfo = %1" ).arg( QString::number(( qulonglong )mProjInfo, 16 ).toLocal8Bit().constData() ) );

OGRFree( wkt );
}

if ( !mProjInfo || !mProjUnits )
Expand Down

0 comments on commit 8391d1a

Please sign in to comment.