Skip to content
Permalink
Browse files

fix #3602

git-svn-id: http://svn.osgeo.org/qgis/trunk@15465 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 13, 2011
1 parent 9cca04d commit 8391d1a870f32b7f55a97f4e9009fc3c398ed050
Showing with 5 additions and 11 deletions.
  1. +5 −11 src/plugins/grass/qgsgrassnewmapset.cpp
@@ -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 ) );
@@ -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 )

0 comments on commit 8391d1a

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