VectorDataTransform - Vector Data Transformation

Apply a transform to each vertex of the input VectorData

Detailed description

This application iterates over each vertex in the input vector data file and performs a transformation on this vertex.

It is the equivalent of [1] that transforms images. For instance, if you extract the envelope of an image with [2], and you transform this image with [1], you may want to use this application to operate the same transform on the envelope.

The applied transformation is a 2D similarity. It manages translation, rotation, scaling, and can be centered or not. Note that the support image is used to define the reference coordinate system in which the transform is applied. For instance the input vector data can have WGS84 coordinates, the support image is in UTM, so a translation of 1 pixel along X corresponds to the X pixel size of the input image along the X axis of the UTM coordinates frame. This image can also be in sensor geometry.

Parameters

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

[1]Table: Parameters table for Vector Data Transformation.
Parameter Key Parameter Name Parameter Type
vd Input Vector data Input vector data
out Output Vector data Output vector data
in Support image Input image
transform Transform parameters Group
transform.tx X Translation Float
transform.ty Y Translation Float
transform.ro Rotation Angle Float
transform.centerx Center X Float
transform.centery Center Y Float
transform.scale Scale Float
inxml Load otb application from xml file XML input parameters file
outxml Save otb application to xml file XML output parameters file

Input Vector data: Input vector data file to transform.

Output Vector data: Output vector data with .

Support image: Image defining the reference coordinate system in which the transform is applied. Both projected and sensor images are supported.

[Transform parameters]: Group of parameters to define the transform.

  • X Translation: Translation in the X direction (in pixels).
  • Y Translation: Translation in the Y direction (in pixels).
  • Rotation Angle: Angle of the rotation (in degrees).
  • Center X: X coordinate of the rotation and scaling center (in physical units).
  • Center Y: Y coordinate of the rotation and scaling center (in physical units).
  • Scale: The scale coefficient to apply.

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.

See Also

These additional resources can be useful for further information:
[1] RigidTransformResample
[2] ImageEnvelope