4.2.6 Vector Data Transformation

Apply a transform to each vertex of the input VectorData

Detailed description

This application performs a transformation of an input vector data transforming each vertex in the vector data. The applied transformation manages translation, rotation and scale, and can be centered or not.

Parameters

This section describes in details the parameters available for this application. Table 4.38, page 489 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is VectorDataTransform.





Parameter key

Parameter type

Parameter description




vd

Input vector data

Input Vector data

out

Output vector data

Output Vector data

in

Input image

Support image

transform

Group

Transform parameters

transform.tx

Float

Translation X

transform.ty

Float

Translation Y

transform.ro

Float

Rotation Angle

transform.centerx

Float

Center X

transform.centery

Float

Center Y

transform.scale

Float

Scale

inxml

XML input parameters file

Load otb application from xml file

outxml

XML output parameters file

Save otb application to xml file











Table 4.38: Parameters table for Vector Data Transformation.

Input Vector data Input vector data to transform

Output Vector data Output transformed vector data

Support image Image needed as a support to the vector data

Transform parameters Group of parameters to define the transform

Load otb application from xml file Load otb application from xml file

Save otb application to xml file Save otb application to xml file

Example

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

otbcli_VectorDataTransform -vd qb_RoadExtract_easyClassification.shp -in qb_RoadExtract.tif -out VectorDataTransform.shp -transform.ro 5

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

#!/usr/bin/python 
 
# Import the otb applications package 
import otbApplication 
 
# The following line creates an instance of the VectorDataTransform application 
VectorDataTransform = otbApplication.Registry.CreateApplication("VectorDataTransform") 
 
# The following lines set all the application parameters: 
VectorDataTransform.SetParameterString("vd", "qb_RoadExtract_easyClassification.shp") 
 
VectorDataTransform.SetParameterString("in", "qb_RoadExtract.tif") 
 
VectorDataTransform.SetParameterString("out", "VectorDataTransform.shp") 
 
VectorDataTransform.SetParameterFloat("transform.ro", 5) 
 
# The following line execute the application 
VectorDataTransform.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.