# GenerateRPCSensorModel¶

Generate a RPC sensor model from a list of Ground Control Points.

## Description¶

This application generates a RPC sensor model from a list of Ground Control Points. At least 20 points are required for estimation without elevation support, and 40 points for estimation with elevation support. Elevation support will be automatically deactivated if an insufficient amount of points is provided. The application can optionally output a file containing accuracy statistics for each point, and a vector file containing segments representing points residues. The map projection parameter allows defining a map projection in which the accuracy is evaluated.

## Parameters¶

Output geom file -outgeom filename [dtype] Mandatory
Geom file containing the generated RPC sensor model

Input file containing tie points -inpoints filename [dtype] Mandatory
Input file containing tie points. Points are stored in following format: col row lon lat. Spaced by a space or tab character. Line beginning with # are ignored.

Output file containing output precision statistics -outstat filename [dtype]
Output file containing the following info: ref_lon ref_lat elevation predicted_lon predicted_lat x_error_ref(meters) y_error_ref(meters) global_error_ref(meters) x_error(meters) y_error(meters) overall_error(meters)

Output vector file with residues -outvector filename [dtype]
File containing segments representing residues

Map Projection -map [utm|lambert2|lambert93|wgs|epsg] Default value: utm
Defines the map projection to be used.

• Universal Trans-Mercator (UTM)
A system of transverse mercator projections dividing the surface of Earth between 80S and 84N latitude.
• Lambert II Etendu
This is a Lambert Conformal Conic projection mainly used in France.
• Lambert93
This is a Lambert 93 projection mainly used in France.
• WGS 84
This is a Geographical projection
• EPSG Code
This code is a generic way of identifying map projections, and allows specifying a large amount of them. See www.spatialreference.org to find which EPSG code is associated to your projection;

### Universal Trans-Mercator (UTM) options¶

Zone number -map.utm.zone int Default value: 31
The zone number ranges from 1 to 60 and allows defining the transverse mercator projection (along with the hemisphere)

Northern Hemisphere -map.utm.northhem bool Default value: false
The transverse mercator projections are defined by their zone number as well as the hemisphere. Activate this parameter if your image is in the northern hemisphere.

### EPSG Code options¶

EPSG Code -map.epsg.code int Default value: 4326
See www.spatialreference.org to find which EPSG code is associated to your projection

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

DEM directory -elev.dem directory
This parameter allows selecting a directory containing Digital Elevation Model files. Note that this directory should contain only DEM files. Unexpected behaviour might occurs if other images are found in this directory.

Geoid File -elev.geoid filename [dtype]
Use a geoid grid to get the height above the ellipsoid in case there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles. A version of the geoid can be found on the OTB website(https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/blob/master/Input/DEM/egm96.grd).

Default elevation -elev.default float Default value: 0
This parameter allows setting the default height above ellipsoid when there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles, and no geoid file has been set. This is also used by some application as an average elevation value.

Load parameters from XML -inxml filename.xml
Load application parameters from an XML file.

Save parameters to XML -outxml filename.xml
Save application parameters to an XML file.

## Examples¶

From the command-line:

otbcli_GenerateRPCSensorModel -outgeom output.geom -inpoints points.txt -map epsg -map.epsg.code 32631


From Python:

import otbApplication

app = otbApplication.Registry.CreateApplication("GenerateRPCSensorModel")

app.SetParameterString("outgeom", "output.geom")
app.SetParameterString("inpoints", "points.txt")
app.SetParameterString("map","epsg")
app.SetParameterInt("map.epsg.code", 32631)

app.ExecuteAndWriteOutput()