Raster histogram

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
(Using R scripts)
(Using R scripts)
Line 11: Line 11:
 
== Using R scripts ==
 
== Using R scripts ==
 
# If the processing toolbox is not visible, select {{mitem|text=Processing --> Toolbox}}.  
 
# If the processing toolbox is not visible, select {{mitem|text=Processing --> Toolbox}}.  
# In the processing toolbar, type {{typed|text=Get R scripts}} into the search field and click to open it. In the ''Install scripts and model windows'' unfold the folder ''Not installed'' and activate ''Advanced histogram'' as shown below in the screenshot.  
+
# In the processing toolbar, type {{typed|text=Get R scripts}} into the search field and click to open it. In the ''Install scripts and model windows'' unfold the folder ''Not installed'' and activate ''Advanced histogram'' as shown below in the screenshot. Click {{button|text=OK}}.
 
[[File:Qgis_Get_Rscripts.png|200px]].  
 
[[File:Qgis_Get_Rscripts.png|200px]].  
Click {{button|text=OK}}. # In the processing toolbar, type {{typed|text=Get R scripts}} into the search field and click to open the diaolog window. Specify the Input raster Layer and click the button {{button|text=...}} on to select the path and filename for the output graphics file. Click {{button|text=Run}}.
+
# In the processing toolbar, type {{typed|text=Get R scripts}} into the search field and click to open the diaolog window. Specify the Input raster Layer and click the button {{button|text=...}} on to select the path and filename for the output graphics file. Click {{button|text=Run}}.
[[File:Qgis_advanced_histogram.png|200px]].  
+
[[File:Qgis_advanced_histogram.png|400px]].
Be patient and have a look on the messages in the log window as some additional R packages need to be downloaded. The resulting ggraphics shows side all histograms of the raster bands side by side.
+
Be patient and have a look on the messages in the log window as some additional R packages need to be downloaded. The resulting graphics shows all histograms side by side.
[[File:histogram_result.png|200px]]
+
[[File:histogram_result.png|400px]]
 
[[Category: Working with Raster Data]]
 
[[Category: Working with Raster Data]]

Revision as of 21:08, 22 October 2017

Using Layer Properties

  1. Click the Add raster layer QGIS 2.0 addrast.png and select the file C:/OSGeo4W64/geodata/raster/s2/Subset_S2A_MSIL2A_20170619T.tif.
  2. After clicking Open , the raster layer appears on the QGIS canvas.
  3. Right click the layer name in the Layers panel and select Properties --> Histogramm

This dialog displays a histogram for all bands band. Left click and drag a box on the diagram to zoom in. Click on Pref/Actions and activate Draw as lines (Figure A).

Figure A: Line histograms of all bands

Click on Pref/Actions and deactivate Draw as lines. Activate Show selected band and Always show min/max markers.

The value range of the selected band data is evenly divided into bins. The histogram shows how many pixels of the image fall into each of the bins (Figure B)
Figure B: Histogram of a single selected band
. Click on Qgis save icon.png. The graphics may be saved as png file.

Using R scripts

  1. If the processing toolbox is not visible, select Processing --> Toolbox.
  2. In the processing toolbar, type Get R scripts into the search field and click to open it. In the Install scripts and model windows unfold the folder Not installed and activate Advanced histogram as shown below in the screenshot. Click OK.

Qgis Get Rscripts.png.

  1. In the processing toolbar, type Get R scripts into the search field and click to open the diaolog window. Specify the Input raster Layer and click the button ... on to select the path and filename for the output graphics file. Click Run.

Qgis advanced histogram.png. Be patient and have a look on the messages in the log window as some additional R packages need to be downloaded. The resulting graphics shows all histograms side by side. Histogram result.png

Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export