Data type conversion

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
We may change the data type (or radiometric resolution) of a raster layer.  
 
We may change the data type (or radiometric resolution) of a raster layer.  
# Click the {{button|text=Add raster layer}} [[Image:QGIS_2.0_addrast.png|20px]] and select a single band file  ''/geodata/raster/s2/Subset_S2A_MSIL2A_20170619T_B03.tif''. This is a spectral green band with the data type '''UInt16 - Sixteen bit unsigned integer Unsigned Integer''' with the value range 0 to 65535 (Check the [[Raster metadata]]). We would like to convert the raster to data type '''Byte - eight bit unsigned integer''',  value range 0 to 255.
+
# Click the {{button|text=Add raster layer}} [[Image:QGIS_2.0_addrast.png|20px]] and select a single band file  ''/geodata/raster/s2/Subset_S2A_MSIL2A_20170619T_B03.tif''. This is a spectral green band with the data type '''UInt16 - Sixteen bit unsigned integer''' with the value range 0 to 65535 (Check the [[Raster metadata]]). We would like to convert the raster to data type '''Byte - eight bit unsigned integer''',  value range 0 to 255.
 
# Click {{button|text=Open}}.
 
# Click {{button|text=Open}}.
 
# In processing toolbar, type {{typed|text=Rescale}} into the search field to find the {{button|text=Orfeo Toolbox --> Image Manipulation --> Rescale Image)}} tool. Open it with a double click. Specify a new output file name as shown in the screenshot.
 
# In processing toolbar, type {{typed|text=Rescale}} into the search field to find the {{button|text=Orfeo Toolbox --> Image Manipulation --> Rescale Image)}} tool. Open it with a double click. Specify a new output file name as shown in the screenshot.
Line 6: Line 6:
 
[[File:Qgis_rescale.png|400px]]
 
[[File:Qgis_rescale.png|400px]]
  
The output Image raster is now recoded to correct eight bit data range but the data type is now '''Float32 - Thirty two bit floating point'''. Note, the Ouput pixel type option {{typed|text=uint8}} currently does not work!
+
The output Image raster is now recoded to correct eight bit data range but the data type is now '''Float32 - Thirty two bit floating point'''. Note, the Output pixel type option {{typed|text=uint8}} currently does not work!
 
# In the processing toolbar, type {{typed|text=Convert data}} into the search field to find the {{button|text=SAGA --> Raster tools --> Convert data storage)}} tool. Open  with a double click.
 
# In the processing toolbar, type {{typed|text=Convert data}} into the search field to find the {{button|text=SAGA --> Raster tools --> Convert data storage)}} tool. Open  with a double click.
 
Specify  
 
Specify  

Revision as of 12:29, 29 October 2018

We may change the data type (or radiometric resolution) of a raster layer.

  1. Click the Add raster layer QGIS 2.0 addrast.png and select a single band file /geodata/raster/s2/Subset_S2A_MSIL2A_20170619T_B03.tif. This is a spectral green band with the data type UInt16 - Sixteen bit unsigned integer with the value range 0 to 65535 (Check the Raster metadata). We would like to convert the raster to data type Byte - eight bit unsigned integer, value range 0 to 255.
  2. Click Open.
  3. In processing toolbar, type Rescale into the search field to find the Orfeo Toolbox --> Image Manipulation --> Rescale Image) tool. Open it with a double click. Specify a new output file name as shown in the screenshot.

Qgis rescale.png

The output Image raster is now recoded to correct eight bit data range but the data type is now Float32 - Thirty two bit floating point. Note, the Output pixel type option uint8 currently does not work!

  1. In the processing toolbar, type Convert data into the search field to find the SAGA --> Raster tools --> Convert data storage) tool. Open with a double click.

Specify

  • Data storage type: [1] unsigned 1 byte integer
  • Converted grid: a new output file name. Click Run.

Qgis convert data storage.png

Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export