ComputeOGRLayersFeaturesStatistics¶
计算一组OGR图层中要素的统计数据
描述¶
计算一组OGR层中要素的统计数据(平均值和标准差),并将其写入一个XML文件。然后,培训应用程序可以使用生成的XML文件。
参数¶
Vector Data -inshp vectorfile Mandatory
Name of the input shapefile
Output XML file -outstats filename [dtype] Mandatory
XML file containing mean and variance of each feature.
Feature -feat string1 string2...
List of features to consider for statistics.
实例¶
从命令行执行以下操作:
otbcli_ComputeOGRLayersFeaturesStatistics -inshp vectorData.shp -outstats results.xml -feat perimeter
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("ComputeOGRLayersFeaturesStatistics")
app.SetParameterString("inshp", "vectorData.shp")
app.SetParameterString("outstats", "results.xml")
app.SetParameterStringList("feat", ['perimeter'])
app.ExecuteAndWriteOutput()
局限性¶
实验性的。目前仅支持shapefile。
另请参阅¶
OGRLayerClassifier,:ref:TrainVectorClassifier