Split stack
From AWF-Wiki
(Difference between revisions)
(→Using GDAL Translate) |
(→Using GDAL Translate) |
||
Line 9: | Line 9: | ||
=Using GDAL Translate= | =Using GDAL Translate= | ||
− | + | * In the processing toolbar, type {{typed|text=Translate}} into the search field to find the {{button|text=GDAL\OGR --> Translate (Convert format)}} tool and open it. | |
− | + | * Change the output data format to unsigned 16bit integer): {{typed|text=-ot UInt16}} | |
− | + | * Click the button {{button|text=...}} of '''Converted''' to select path and name of output file. | |
+ | |||
[[File:Qgis_split_stack.png|600px]] | [[File:Qgis_split_stack.png|600px]] | ||
− | |||
− | |||
− | |||
− | |||
− | ** Repeat the steps for other bands: change the name of the output file and edit the -b option accordingly. | + | * Open the the OSGEO4W Shell. {{mitem|text=Start --> All Programs --> OSGeo4W --> OSGeo4W Shell}} |
+ | * Copy the content of the ''GDL/OGR console call'' and paste it into the OSGeo4W Shell. | ||
+ | * Edit the command in OSGeo4W Shell by adding the option {{typed|text=-b 1}} to output only the first band. | ||
+ | * Press {{button|Enter}} to execute the command in OSGeo4W Shell. | ||
+ | |||
+ | * Repeat the steps for other bands: change the name of the output file and edit the -b option accordingly. | ||
− | + | * Create a multiband file with a spectral subset of 4 bands. Change the output file and edit the command in OSGeo4W Shell additional creation options: | |
− | ** '''Converted''' output file:{{typed|text=Subset_S2A_MSIL2A_20170619T_B02- | + | **'''Converted''' output file:{{typed|text=Subset_S2A_MSIL2A_20170619T_B02- |
-B03-B04-B08.tif}} | -B03-B04-B08.tif}} | ||
** '''Additional creation parameters:''' {{typed|text=-b 2 -b 3 -b 4 -b 8}} | ** '''Additional creation parameters:''' {{typed|text=-b 2 -b 3 -b 4 -b 8}} |
Revision as of 19:41, 21 October 2018
Using OTB SplitImage
- Click the Open Data Source Manager and then Add raster layer and select the file /geodata/raster/s2/Subset_S2A_MSIL2A_20170619T_MUL.tif.
- In processing toolbox, type split image into the search field to find the OTB --> Image Manipulation --> SplitImage tool and open it.
The Output pixel type is float. (Note, the option int does currently not work!). Choose an output file name: Save to file. Run in background. The resulting single band files need to be loaded manually into the map canvas.
Using GDAL Translate
- In the processing toolbar, type Translate into the search field to find the GDAL\OGR --> Translate (Convert format) tool and open it.
- Change the output data format to unsigned 16bit integer): -ot UInt16
- Click the button ... of Converted to select path and name of output file.
- Open the the OSGEO4W Shell. Start --> All Programs --> OSGeo4W --> OSGeo4W Shell
- Copy the content of the GDL/OGR console call and paste it into the OSGeo4W Shell.
- Edit the command in OSGeo4W Shell by adding the option -b 1 to output only the first band.
- Press {{{text}}} to execute the command in OSGeo4W Shell.
- Repeat the steps for other bands: change the name of the output file and edit the -b option accordingly.
- Create a multiband file with a spectral subset of 4 bands. Change the output file and edit the command in OSGeo4W Shell additional creation options:
- Converted output file:Subset_S2A_MSIL2A_20170619T_B02-
-B03-B04-B08.tif
- Additional creation parameters: -b 2 -b 3 -b 4 -b 8
- Press {{{text}}} to execute the command OSGeo4W Shell.