Classify an OGR layer based on a machine learning model and a list of features to consider.
This application will apply a trained machine learning model on the selected feature to get a classification of each geometry contained in an OGR layer. The list of feature must match the list used for training. The predicted label is written in the user defined field for each geometry.
This section describes in details the parameters available for this application. Table 4.154, page 806 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is OGRLayerClassifier.
Parameter key | Parameter type |
Parameter description |
inshp | Input vector data |
Name of the input shapefile |
instats | Input File name |
XML file containing mean and variance of each feature. |
insvm | Output File name |
Input model filename. |
feat | List |
Features |
cfield | String |
Field containing the predicted class. |
inxml | XML input parameters file |
Load otb application from xml file |
outxml | XML output parameters file |
Save otb application to xml file |
|
||
|
||
|
||
|
||
|
To run this example in command-line, use the following:
To run this example from Python, use the following code snippet:
Experimental. Only shapefiles are supported for now.
This application has been written by David Youssefi during internship at CNES.
These additional ressources can be useful for further information: