ComputeOGRLayersFeaturesStatistics - ComputeOGRLayersFeaturesStatistics

Compute statistics of the features in a set of OGR Layers

Detailed description

Compute statistics (mean and standard deviation) of the features in a set of OGR Layers, and write them in an XML file. This XML file can then be used by the training application.

Parameters

This section describes in details the parameters available for this application. Table [1] presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is ComputeOGRLayersFeaturesStatistics .

[1]Table: Parameters table for ComputeOGRLayersFeaturesStatistics.
Parameter Key Parameter Name Parameter Type
inshp Vector Data Input vector data
outstats Output XML file Output File name
feat Feature List
inxml Load otb application from xml file XML input parameters file
outxml Save otb application to xml file XML output parameters file
  • Vector Data: Name of the input shapefile.
  • Output XML file: XML file containing mean and variance of each feature.
  • Feature: List of features to consider for statistics.
  • Load otb application from xml file: Load otb application from xml file.
  • Save otb application to xml file: Save otb application to xml file.

Example

To run this example in command-line, use the following:

otbcli_ComputeOGRLayersFeaturesStatistics -inshp vectorData.shp -outstats results.xml -feat perimeter

To run this example from Python, use the following code snippet:

#!/usr/bin/python

# Import the otb applications package
import otbApplication

# The following line creates an instance of the ComputeOGRLayersFeaturesStatistics application
ComputeOGRLayersFeaturesStatistics = otbApplication.Registry.CreateApplication("ComputeOGRLayersFeaturesStatistics")

# The following lines set all the application parameters:
ComputeOGRLayersFeaturesStatistics.SetParameterString("inshp", "vectorData.shp")

ComputeOGRLayersFeaturesStatistics.SetParameterString("outstats", "results.xml")

# The following line execute the application
ComputeOGRLayersFeaturesStatistics.ExecuteAndWriteOutput()

Limitations

Experimental. For now only shapefiles are supported.

Authors

This application has been written by David Youssefi during internship at CNES.

See Also

These additional resources can be useful for further information:
OGRLayerClassifier,TrainVectorClassifier