VectorDataSetField

Set a field in vector data.

Description

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

Parameters

Input -in vectorfile Mandatory
Input Vector Data

Output -out vectorfile Mandatory
Output Vector Data

Field -fn string Mandatory
Field name

Value -fv string Mandatory
Field value

Examples

From the command-line:

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

From Python:

import otbApplication

app = otbApplication.Registry.CreateApplication("VectorDataSetField")

app.SetParameterString("in", "qb_RoadExtract_classification.shp")
app.SetParameterString("out", "VectorDataSetField.shp")
app.SetParameterString("fn", "Info")
app.SetParameterString("fv", "Sample polygon")

app.ExecuteAndWriteOutput()

Limitations

Doesn’t work with KML files yet