4.6.2 Compute Polyline Feature From Image

This application compute for each studied polyline, contained in the input VectorData, the chosen descriptors.

Detailed description

The first step in the classifier fusion based validation is to compute, for each studied polyline, the chosen descriptors.

Parameters

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





Parameter key

Parameter type

Parameter description




in

Input image

Input Image

vd

Input vector data

Vector Data

elev

Group

Elevation management

elev.dem

Directory

DEM directory

elev.geoid

Input File name

Geoid File

elev.default

Float

Default elevation

expr

String

Feature expression

field

String

Feature name

out

Output vector data

Output Vector Data

inxml

XML input parameters file

Load otb application from xml file

outxml

XML output parameters file

Save otb application to xml file











Table 4.80: Parameters table for Compute Polyline Feature From Image.

Input Image An image to compute the descriptors on.

Vector Data Vector data containing the polylines where the features will be computed.

Elevation management This group of parameters allows managing elevation values. Supported formats are SRTM, DTED or any geotiff. DownloadSRTMTiles application could be a useful tool to list/download tiles related to a product.

Feature expression The feature formula (b1 <0.3) where b1 is the standard name of input image first band

Feature name The field name corresponding to the feature codename (NONDVI, ROADSA...)

Output Vector Data The output vector data containing polylines with a new field

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_ComputePolylineFeatureFromImage -in NDVI.TIF -vd roads_ground_truth.shp -expr "(b1 > 0.4)" -field NONDVI -out PolylineFeatureFromImage_LI_NONDVI_gt.shp

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 ComputePolylineFeatureFromImage application 
ComputePolylineFeatureFromImage = otbApplication.Registry.CreateApplication("ComputePolylineFeatureFromImage") 
 
# The following lines set all the application parameters: 
ComputePolylineFeatureFromImage.SetParameterString("in", "NDVI.TIF") 
 
ComputePolylineFeatureFromImage.SetParameterString("vd", "roads_ground_truth.shp") 
 
ComputePolylineFeatureFromImage.SetParameterString("expr", "(b1 > 0.4)") 
 
ComputePolylineFeatureFromImage.SetParameterString("field", "NONDVI") 
 
ComputePolylineFeatureFromImage.SetParameterString("out", "PolylineFeatureFromImage_LI_NONDVI_gt.shp") 
 
# The following line execute the application 
ComputePolylineFeatureFromImage.ExecuteAndWriteOutput()

Limitations

Since it does not rely on streaming process, take care of the size of input image before launching application.

Authors

This application has been written by OTB-Team.