Skip to content
Permalink
Browse files

[GRASS] set proj/zone on imported rasters, fixes #13725

  • Loading branch information
blazek committed Nov 1, 2015
1 parent daa6510 commit 24960da08a566b6c2e15b60c80cad637f800a3e3
Showing with 15 additions and 0 deletions.
  1. +5 −0 src/providers/grass/qgis.r.in.cpp
  2. +10 −0 src/providers/grass/qgsgrassimport.cpp
@@ -108,6 +108,9 @@ int main( int argc, char **argv )
stdoutFile.open( stdout, QIODevice::WriteOnly | QIODevice::Unbuffered );
QDataStream stdoutStream( &stdoutFile );

qint32 proj, zone;
stdinStream >> proj >> zone;

QgsRectangle extent;
qint32 rows, cols;
stdinStream >> extent >> cols >> rows;
@@ -118,6 +121,8 @@ int main( int argc, char **argv )
{
G_fatal_error( "Cannot set region: %s", err.toUtf8().data() );
}
window.proj = ( int ) proj;
window.zone = ( int ) zone;

G_set_window( &window );

@@ -241,6 +241,14 @@ bool QgsGrassRasterImport::import()
return false;
}


struct Cell_head defaultWindow;
if ( !QgsGrass::defaultRegion( mGrassObject.gisdbase(), mGrassObject.location(), &defaultWindow ) )
{
setError( "Cannot get default window" );
return false;
}

int redBand = 0;
int greenBand = 0;
int blueBand = 0;
@@ -326,6 +334,8 @@ bool QgsGrassRasterImport::import()

QDataStream outStream( mProcess );

outStream << ( qint32 ) defaultWindow.proj;
outStream << ( qint32 ) defaultWindow.zone;
outStream << mExtent << ( qint32 )mXSize << ( qint32 )mYSize;
outStream << ( qint32 )qgis_out_type;

0 comments on commit 24960da

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