User Tools

Site Tools


wiki:geotools_zonal_stat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:geotools_zonal_stat [2019/07/07 08:04]
wiki:geotools_zonal_stat [2019/07/07 08:04] (current)
Line 1: Line 1:
 +===== NAME =====
 +**ost4sem_zonal_stats.py**
 +
 +===== DESCRIPTION =====
 +This command line zonal statistic calculator is built for gdal supported files.\\
 +It calculates mean min max and stdev values of a continuos raster (e.g. dem) based on a different categorized raster.\\
 +The output is a txt file with the statistical value of each category.\\
 +
 +===== SYNOPSIS =====
 +
 +ost4sem\_zonal\_stats.py ​ [-category\_no\_data nodata\_value] ​ [-raster\_no\_data nodata\_value]\\
 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [-mean] [-mode] [-median] [-stddev] [-min] [-max] [-sum]\\
 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ src\_category ​  ​src\_raster ​  ​dst\_file\\
 +
 +-category\_no\_data nodata\_value : no data value in the category raster. \\
 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ No data value can be identify by the user or directly take in tif\\
 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ but the "​NoData Value=?"​ must be present in the tif.
 +\\
 +-raster\_no\_data nodata\_value : no data value in the continuos raster. \\
 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ No data value can be identify by the user or directly take in tif\\
 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ but the "​NoData Value=?"​ must be present in the tif.\\
 +src\_category : category raster ; layer used to group values for computing statisctics \\
 +src\_raster :   ​continues raster ; layer used to perform statisctics \\
 +dst\_file : destination file in txt format.
 +\\
 +\\
 +[OPTIONS]\\
 +\\
 +If no option are reported the category value and counted pixel for each category will be reported in the destination file.\\
 +\\
 +-max : calculate maximum value of the continues raster in each grouped category \\
 +-min : calculate min value of the continues raster in each grouped category \\
 +-stddev : calculate standard deviation value of the continues raster in each grouped category \\
 +-mean  : calculate mean value of the continues raster in each grouped category \\
 +\\
 +
 +<code bash>
 +wget www.spatial-ecology.net/​ost4sem/​geo_tools/​ost4sem_zonal_stats.py.zip
 +mv ./​ost4sem_zonal_stats.py.zip ./​ost4sem_zonal_stats.py
 +chmod 777 ./​ost4sem_zonal_stats.py
 +./​ost4sem_zonal_stats.py -max -min -stddev -mean   ​category.tif dem.tif stat.txt
 +</​code>​
  
wiki/geotools_zonal_stat.txt ยท Last modified: 2019/07/07 08:04 (external edit)