VectorDataSetField¶
Set a field in vector data.
Description¶
Set a specified field to a specified value on all features of a vector data.
This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.
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