Skip to content
Permalink
Browse files
GRASS region reprojection fix
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 61a96e8409185076ed6b9db5442ec8afc8096430
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/plugins/grass/qgsgrassplugin.cpp
@@ -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()
@@ -118,9 +111,8 @@ void QgsGrassPlugin::initGui()
mRegion = 0;

QSettings settings;

QgsGrass::init();

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

// Connect project
@@ -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() );

0 comments on commit 61a96e8

Please sign in to comment.