VectorDataSetField - Vector data set field

Set a field in vector data.

Detailed description

Set a specified field to a specified value on all features of a vector data.


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 VectorDataSetField .

[1]Table: Parameters table for Vector data set field.
Parameter Key Parameter Name Parameter Type
in Input Input vector data
out Output Output vector data
fn Field String
fv Value String
inxml Load otb application from xml file XML input parameters file
outxml Save otb application to xml file XML output parameters file
  • Input: Input Vector Data.
  • Output: Output Vector Data.
  • Field: Field name.
  • Value: Field value.
  • Load otb application from xml file: Load otb application from xml file.
  • Save otb application to xml file: Save otb application to xml file.


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

otbcli_VectorDataSetField -in qb_RoadExtract_classification.shp -out VectorDataSetField.shp -fn Info -fv Sample polygon

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


# Import the otb applications package
import otbApplication

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

# The following lines set all the application parameters:
VectorDataSetField.SetParameterString("in", "qb_RoadExtract_classification.shp")

VectorDataSetField.SetParameterString("out", "VectorDataSetField.shp")

VectorDataSetField.SetParameterString("fn", "Info")

VectorDataSetField.SetParameterString("fv", "Sample polygon")

# The following line execute the application


Doesn’t work with KML files yet


This application has been written by OTB-Team.