mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[GRASS] set proj/zone on imported rasters, fixes #13725
This commit is contained in:
parent
daa6510970
commit
24960da08a
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user