Skip to main content
Omnitracs Knowledge Base

Compute Line of Sight Distance and Direction - OMLOSDD

Compute Line of Sight Distance and Direction (OMLOSDD)

Required Parameter Group:

1 Function Code Input Char(1)
2 Distance in Seconds Input Char(1)
3 Latitude of Location #1 Input Packed(7,0)
4 Longitude of Location #1 Input Packed(7,0)
5 Date/Time of Location #1 Input Packed(13,0)
6 Latitude of Location #2 Input Packed(7,0)
7 Longitude of Location #2 Input Packed(7,0)
8 Date/Time of Location #2 Input Packed(13,0)
9 Return Distance Output Packed(15,2)
10 Return Units Output Char(3)
11 Return Direction Output Char(3)
12 Return Speed Output Packed(3,0)
13 Return Status Output Char(1)

API Overview:
This API is used to determine the 'line of sight' distance, and optionally the direction and speed traveled between two locations.

Required Parameter Group Details:
(1) Function Code
INPUT; CHAR(1)
This parameter is a function code that instructs the API what action to perform. Valid values are:

D Determine the distance between two locations
B Determine both the distance and the direction between two locations
S Determine the distance, direction, and the speed traveled between two locations

(2) Distance in Seconds
INPUT; CHAR(1)
This parameter indicates if the Return Distance parameter should be in seconds. Valid values are:

Y Return distance value in seconds (do not convert to miles/kilometers)
N Return distance value in miles/kilometers (whichever is the system default)

(3) Latitude of Location #1
INPUT; PACKED(7,0)
This parameter contains the signed latitude coordinate of location #1 in total seconds format; not Degrees, Minutes, Seconds. (Sign indicates hemisphere.)

(4) Longitude of Location #1
INPUT; PACKED(7,0)
This parameter contains the signed longitude coordinate of location #1 in total seconds format; not Degrees, Minutes, Seconds. (Sign indicates hemisphere.)

(5) Date/Time of Location #1
INPUT; PACKED(13,0)
This parameter contains the date/time of location #1 in GMT seconds format; not YMD. This parameter is only required if a function code of 'S' is used.

(6) Latitude of Location #2
INPUT; PACKED(7,0)
This parameter contains the signed latitude coordinate of location #2 in total seconds format; not Degrees, Minutes, Seconds. (Sign indicates hemisphere.)

(7) Longitude of Location #2
INPUT; PACKED(7,0)
This parameter contains the signed longitude coordinate of location #2 in total seconds format; not Degrees, Minutes, Seconds. (Sign indicates hemisphere.)

(8) Date/Time of Location #2
INPUT; PACKED(13,0)
This parameter contains the date/time of location #2 in GMT seconds format; not YMD. This parameter is only required if a function code of 'S' is used.

(9) Return Distance
OUTPUT; PACKED(15,2)
This parameter returns the distance in miles (or kilometers) between locations #1 and #2. The units returned are based on the system value in the QTRACS System Configuration menu.

(10) Return Units
OUTPUT; CHAR(3)
This parameter returns the distance's displayable units abbreviation. The US version of the software will return 'mls' (miles) or 'kms' (kilometers). The units are based on the system value in the QTRACS System Configuration menu and the international text established from the message file, TRAQMSGF.

(11) Return Direction
OUTPUT; CHAR(3)
This parameter returns the direction of the second location relative to the first location. For example, 'the second location is WNW of the first location'. The US version of the software will return 'N', 'S', 'E', 'W', or some combination thereof. The direction abbreviations are based on the international text established from the message file, TRAQMSGF.

(12) Return Speed
OUTPUT; PACKED(3,0)
This parameter returns the speed traveled in units per hour (miles or kilometers) between the first location and the second location.

(13) Return Status
OUTPUT; CHAR(1)
Status value returned to the caller will be set as follows:

0 Success, computations completed and returned
1 Failure, error in computations
  • Was this article helpful?