1.3.2 Using the command-line launcher

The command-line application launcher allows to load an application plugin, to set its parameters, and execute it using the command line. Launching the otbApplicationLauncherCommandLine without argument results in the following help to be displayed:

$ otbApplicationLauncherCommandLine  
Usage : ./otbApplicationLauncherCommandLine module_name [MODULEPATH] [arguments]

The module_name parameter corresponds to the application name. The [MODULEPATH] argument is optional and allows to pass to the launcher a path where the shared library (or plugin) corresponding to module_name is.

It is also possible to set this path with the environment variable OTB_APPLICATION_PATH, making the [MODULEPATH] optional. This variable is checked by default when no [MODULEPATH] argument is given. When using multiple paths in OTB_APPLICATION_PATH, one must make sure to use the standard path separator of the target system, which is : on Unix, and ; on Windows.

An error in the application name (i.e. in parameter module_name) will make the otbApplicationLauncherCommandLine lists the name of all applications found in the available path (either [MODULEPATH] and/or OTB_APPLICATION_PATH).

To ease the use of the applications, and try avoiding extensive environment customization, ready-to-use scripts are provided by the OTB installation to launch each application, and takes care of adding the standard application installation path to the OTB_APPLICATION_PATH environment variable.

These scripts are named otbcli_<ApplicationName> and do not need any path settings. For example you can start the Orthorectification application with the script called otbcli_Orthorectification.

Launching an application with no or incomplete parameters will make the launcher display a summary of the parameters, indicating the mandatory parameters missing to allow for application execution. Here is an example with the OrthoRectification application:

$ otbcli_OrthoRectification  
 
ERROR: Waiting for at least one parameter...  
 
====================== HELP CONTEXT ======================  
NAME: OrthoRectification  
DESCRIPTION: This application allows to ortho-rectify optical images from supported sensors.  
 
EXAMPLE OF USE:  
otbcli_OrthoRectification -io.in QB_TOULOUSE_MUL_Extract_500_500.tif -io.out QB_Toulouse_ortho.tif  
 
DOCUMENTATION: http://www.orfeo-toolbox.org/Applications/OrthoRectification.html  
======================= PARAMETERS =======================  
        -progress                        <boolean>        Report progress  
MISSING -io.in                           <string>         Input Image  
MISSING -io.out                          <string> [pixel] Output Image  [pixel=uint8/int8/uint16/int16/uint32/int32/float/double]  
        -map                             <string>         Output Map Projection [utm/lambert2/lambert93/transmercator/wgs/epsg]  
MISSING -map.utm.zone                    <int32>          Zone number  
        -map.utm.northhem                <boolean>        Northern Hemisphere  
        -map.transmercator.falseeasting  <float>          False easting  
        -map.transmercator.falsenorthing <float>          False northing  
        -map.transmercator.scale         <float>          Scale factor  
        -map.epsg.code                   <int32>          EPSG Code  
        -outputs.mode                    <string>         Parameters estimation modes [auto/autosize/autospacing]  
MISSING -outputs.ulx                     <float>          Upper Left X  
MISSING -outputs.uly                     <float>          Upper Left Y  
MISSING -outputs.sizex                   <int32>          Size X  
MISSING -outputs.sizey                   <int32>          Size Y  
MISSING -outputs.spacingx                <float>          Pixel Size X  
MISSING -outputs.spacingy                <float>          Pixel Size Y  
        -outputs.isotropic               <boolean>        Force isotropic spacing by default  
        -elev.dem                        <string>         DEM directory  
        -elev.geoid                      <string>         Geoid File  
        -elev.default                    <float>          Average Elevation  
        -interpolator                    <string>         Interpolation [nn/linear/bco]  
        -interpolator.bco.radius         <int32>          Radius for bicubic interpolation  
        -opt.rpc                         <int32>          RPC modeling (points per axis)  
        -opt.ram                         <int32>          Available memory for processing (in MB)  
        -opt.gridspacing                 <float>          Resampling grid spacing

For a detailed description of the application behaviour and parameters, please check the application reference documentation presented chapter 4, page 389 or follow the DOCUMENTATION hyperlink provided in otbApplicationLauncherCommandLine output. Parameters are passed to the application using the parameter key (which might include one or several . character), prefixed by a -. Command-line examples are provided in chapter 4, page 389.