VectorDataTransform¶
将变换应用于输入VectorData的每个顶点
描述¶
该应用程序遍历输入矢量数据文件中的每个顶点,并对该顶点执行转换。
它相当于 [1] 这会使图像发生变化。例如,如果使用以下命令提取图像的信封 [2] ,您可以使用以下命令转换此图像 [1] ,您可能希望使用此应用程序对信封进行相同的变换。
应用的变换是二维相似性。它管理平移、旋转、缩放,并且可以居中或不居中。请注意,支持图像用于定义应用变换的参考坐标系。例如,输入矢量数据可以具有WGS84坐标,支持图像在UTM中,因此沿X的1个像素的平移对应于输入图像沿UTM坐标帧的X轴的X像素大小。此图像也可以在传感器几何图形中。
参数¶
Input Vector data -vd vectorfile
Mandatory
Input vector data file to transform
Output Vector data -out vectorfile
Mandatory
Output vector data with
Support image -in image
Mandatory
Image defining the reference coordinate system in which the transform is applied. Both projected and sensor images are supported.
变换参数¶
用于定义转换的一组参数
X Translation -transform.tx float
Default value: 0
Translation in the X direction (in pixels)
Y Translation -transform.ty float
Default value: 0
Translation in the Y direction (in pixels)
Rotation Angle -transform.ro float
Default value: 0
Angle of the rotation (in degrees)
Center X -transform.centerx float
Default value: 0
X coordinate of the rotation and scaling center (in physical units)
Center Y -transform.centery float
Default value: 0
Y coordinate of the rotation and scaling center (in physical units)
Scale -transform.scale float
Default value: 1
The scale coefficient to apply
实例¶
从命令行执行以下操作:
otbcli_VectorDataTransform -vd qb_RoadExtract_easyClassification.shp -in qb_RoadExtract.tif -out VectorDataTransform.shp -transform.ro 5
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("VectorDataTransform")
app.SetParameterString("vd", "qb_RoadExtract_easyClassification.shp")
app.SetParameterString("in", "qb_RoadExtract.tif")
app.SetParameterString("out", "VectorDataTransform.shp")
app.SetParameterFloat("transform.ro", 5)
app.ExecuteAndWriteOutput()