Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GRASS] set proj/zone on imported rasters, fixes #13725
(cherry picked from commit 24960da)
- Loading branch information
Showing
with
15 additions
and
0 deletions.
-
+5
−0
src/providers/grass/qgis.r.in.cpp
-
+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; |
|
|
|
|
|