GENAPMODEL

Generate airphoto model


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


GENAPMODEL uses camera information, exterior-orientation data, and map units to generate APMODEL segments for multiple files.
Back to top

Parameters


Name Type Caption Length Value range
MFILE String Input file or folder 0 - 192  
XMLI String Input camera-calibration file name 0 - 192  
CAMPARAM Double Input camera-calibration parameters 0 - 48  
TFILE * String Exterior orientation file name 1 - 192  
MAPUNITS * String EO map units 1 - 16  
EOTYPE * String EO format 1 - 192  
EOVDATUM * String EO vertical datum 3 - 192 ELLIPS | MSL
Default: MSL
ANGUNITS * String EO angle unit 1 - 8 DEGREES | GRADIANS | RADIANS | DMS
ROTKAPPA * Double Angle of rotation 1 - 1 Default: 0.0

* Required parameter
Back to top

Parameter descriptions

MFILE

The name of a folder, image file, or text file in which APMODEL segments are to be generated.

You can specify the value of the MFILE parameter by using any of the following:

XMLI

This parameter is mutually exclusive with CAMPARAM.

The name of the XML file that contains the camera-calibration information.

The following formats are supported:

For more information about the camera-calibration file, follow the link to CAMIMPORT under Related functions at the end of this topic.

CAMPARAM

This parameter is mutually exclusive with XMLI.

It contains a list of camera calibration values, all floating point (double) values.

If set, it must be given values for the first 3 entries: FOCAL LENGTH, CHIP SIZE WIDTH, and CHIP SIZE HEIGHT. The remaining entries can be omitted, and their default values will be used. If you need to set a specific entry, and don't have some of the previous entries, then you need to set all previous missing entries to their defaults. For example: if you have a YSCALE different than the default, then you need to set all previous CAMPARAM entries, either to their default or to the new value.

Note: The return value of the algorithm IIQCOMBINE can be directly passed into the CAMPARAM parameter.

TFILE

The name of the exterior orientation (EO) file. You specify the content of this file (how it is structured) with the EOTYPE parameter.

MAPUNITS

The projection or map units of the EO values in the input EO file.

The standard definitions are:

For a complete list of supported projections and Earth models, see Understanding map projections. For a description of the format of the map units string, see Output units.

EOTYPE

The EOTYPE defines the format of the input EO file.

Supported values are:

IDxxxxxxx dictates the order of the values of each line in the input EO file. Each line in the input EO file must contain seven or eight values: [ID] [C] [C] [C] [O] [O] [O] {T}

where:

Examples:

  1. EOTYPE = IDXYZWPK
    image1  123456.12  2345678.9  1000.0  0.1  0.2  50.0
    • ID=image1
    • X=123456.12
    • Y=2345678.9
    • Z=1000.0
    • W=0.1
    • P=0.2
    • K=50.0

  2. EOTYPE = IDZXYKPWT
    image1  1000.0  123456.12  2345678.9  50.0  0.2  0.1  2023-01-15T10:31:17.749Z
    • Same as example 1, but with addition of T=2023-01-15T10:31:17.749Z

The basenames of each input file from the input file or folder are matched against consecutive IDs. Only files with an exact (case-insensitive) match between the file basename and an image ID are accepted for further processing.

Note: The items on a line, in the TFILE can be separated by any combination of the following characters: {tab}, {space}, {semi-colon}, or {comma}. Consecutive separaters are merged to be considered as a single separator.
Note: Lines that do not match the requested structure are ignored.

EOVDATUM

The elevation/vertical datum of all elevation values in the exterior orientation file.

Supported values are:

If the vertical datum of the DEM and the flying height of the camera differ, the EGM2008 geoid model is used for the conversions during orthorectification.

ANGUNITS

The unit of angle of the EO file.

Supported values are:

You need only specify a value for this parameter when the value of the EOTYPE parameter is IDxxxxxxx.

Note: When you specify DMS as a value, use the format xdx'x. For example: 100d5'29 represents 100 degrees, 5 minutes and 29 seconds.

ROTKAPPA

The angle of rotation to add to the input kappa values in the ANGUNITS parameter.

In some cases, the kappa values in the EO file must be rotated (such as 90, -90 or 180). Apply the correction by specifying the angle of rotation.

Back to top

Details

GENAPMODEL creates APMODEL segments for multiple PIX files. The input is a camera-calibration file in XML format and a text file that contains the EO value for each PIX file. This function supports BINGO, PAT-B, and user-defined EO formats. In some cases, the kappa values in the exterior orientation file are rotated at a constant value, such as 90, -90, or 180. It is possible to correct the kappa values by specifying a value for the ROTKAPPA parameter.

Back to top

Example

Read EO data into the PIX file.

You have multiple files in PIX format and want to create an APMODEL segment for each file. The camera-calibration file is stored in the file camera.xml, and the EO values are stored in the file named eo.dat (input EO file). The format of the file is in the form of IDXYZWPK. A rotation of 100 grad is also applied to the kappa values stored in eo.dat.

EASI>mfile = "*.pix"
EASI>xmli = "camera.xml"
EASI>tfile = "eo.dat"
EASI>mapunits = "UTM 17 d0"
EASI>eotype = "IDXYZWPK"
EASI>eovdatum = "MSL"
EASI>angunits = "GRAD"
EASI>rotkappa = 100

EASI>RUN genapmodel
      

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.