The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Declaration:[1] function CalcLongitude (x, y: integer; var valid: boolean): double;
[2] function CalcLongitude (APoint: TPoint; var valid: boolean): double;

The method CalcLongitude calculates the longitude of the pixel position defined by [x,y] (Version [1]) or APoint (Version [2]). The origin of the pixel coordinates is at the top left corner of the map image. The parameter "valid" returns a FALSE value if the longitude cannot be calculated (e.g. the pixel coordinates are outside the calibration range, or the map is not calibrated at all).

Hint: Please note that the pixel coordinates x and y (or APoint, respectively) are in the reference frame of the scanned map image (and not that of the screen). Thus, you have to transform any screen or mouse coordinates to the map image coordinates (function ControlToMapImage) before applying CalcLongitude.

Example: This method is used in the following example program (see for downloading the code): simplegeomap

Last Update: 2012-Okt-20