Skip to content

Commit

Permalink
GRASS region reprojection fix
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15757 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Apr 18, 2011
1 parent aa615f0 commit 61a96e8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/plugins/grass/qgsgrassplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ QgsGrassPlugin::QgsGrassPlugin( QgisInterface * theQgisInterFace ):
pluginNameQString = tr( "GrassVector" );
pluginVersionQString = tr( "0.1" );
pluginDescriptionQString = tr( "GRASS layer" );
QString gisdbase = QgsGrass::getDefaultGisdbase();
QString location = QgsGrass::getDefaultLocation();
mCanvas = qGisInterface->mapCanvas();
mCrs = QgsGrass::crs( gisdbase, location );
QgsDebugMsg( "mCrs: " + mCrs.toWkt() );
setTransform();
connect( qGisInterface->mapCanvas()->mapRenderer(), SIGNAL( destinationSrsChanged() ), this, SLOT( setTransform() ) );
}

QgsGrassPlugin::~QgsGrassPlugin()
Expand Down Expand Up @@ -118,9 +111,8 @@ void QgsGrassPlugin::initGui()
mRegion = 0;

QSettings settings;

QgsGrass::init();

mCanvas = qGisInterface->mapCanvas();
QWidget* qgis = qGisInterface->mainWindow();

// Connect project
Expand Down Expand Up @@ -598,6 +590,15 @@ void QgsGrassPlugin::displayRegion()

QgsGrass::setLocation( gisdbase, location );

// TODO: check better if we have to init + maybe the location can change -> mCrs must be reloaded
if ( !mCrs.isValid() )
{
mCrs = QgsGrass::crs( gisdbase, location );
QgsDebugMsg( "mCrs: " + mCrs.toWkt() );
setTransform();
connect( mCanvas->mapRenderer(), SIGNAL( destinationSrsChanged() ), this, SLOT( setTransform() ) );
}

struct Cell_head window;
char *err = G__get_window( &window, ( char * ) "", ( char * ) "WIND", mapset.toLatin1().data() );

Expand Down

0 comments on commit 61a96e8

Please sign in to comment.