Count Unique Values In Raster Using SEXTANTE and QGIS

Posted: September 18, 2013 in GIS
Tags: , , , ,

I decided to make my script for counting unique values in raster more usable. Now you can use it via SEXTANTE in QGIS. Download script for SEXTANTE and extract archive to the folder that is is intended for your Python SEXTANTE scripts (for examlple ~./qgis2/processing/scripts). If you don’t know where this folder is located go Processing -> Options and configuration -> Scripts -> Scripts folder, see the screenshot: 

Processing options

Now restart QGIS and in SEXTNTE Toolbox go to Scripts. You will notice new group named Raster processing. There the script named Unique values count will be located:

Launch it and you will see its dialogue window:

Unique values count script main window
Main window

 

Note that Help is available:

Unique values count script help tab

 

Either single- or multi-band rasters are accepted for processing. After the raster is chosen (input field) one need to decide whether to round values for counting or not. If no rounding is needed – leave ‘round values to ndigits‘ field blank. Otherwise enter needed value there. Note that negative values are accepted – this will round values to ndigits before decimal point.

When the set up is finished hit the Run button. You will get something like this:

Result window
Result window
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s