# PolygonClassStatistics

## Brief Description

Computes statistics on a training polygon set.

## Tags

Learning

## Long Description

The application processes a set of geometries intended for training (they should have a field giving the associated class). The geometries are analysed against a support image to compute statistics : - number of samples per class - number of samples per geometry An optional raster mask can be used to discard samples. Different types of geometry are supported : polygons, lines, points. The behaviour is different for each type of geometry : - polygon: select pixels whose center is inside the polygon - lines : select pixels intersecting the line - points : select closest pixel to the point

## Parameters

- [param] -in <string> Support image that will be classified. Mandatory: True. Default Value: ""
- [param] -mask <string> Validity mask (only pixels corresponding to a mask value greater than 0 will be used for statistics). Mandatory: False. Default Value: ""
- [param] -vec <string> Input geometries to analyse. Mandatory: True. Default Value: ""
- [param] -out <string> Output file to store statistics (XML format). Mandatory: True. Default Value: ""
- [param] -field <string> Name of the field carrying the class name in the input vectors.. Mandatory: False. Default Value: "class"
- [param] -layer <int32> Layer index to read in the input vector file.. Mandatory: False. Default Value: "0"
- [param] -ram <int32> Available memory for processing (in MB). Mandatory: False. Default Value: "128"
- [param] -inxml <string> Load otb application from xml file. Mandatory: False. Default Value: ""
- [param] -outxml <string> Save otb application to xml file. Mandatory: False. Default Value: ""

## Limitations

None

## Authors

OTB-Team

## See Also

## Example of use

- in: support_image.tif

- vec: variousVectors.sqlite

- field: label

- out: polygonStat.xml