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



CalcLatitude


Unit:SDL_geomap
Class:TGeoMap
Declaration:[1] function CalcLatitude (x, y: integer; var valid: boolean): double;
[2] function CalcLatitude (APoint: TPoint; var valid: boolean): double;

The method CalcLatitude calculates the latitude of the pixel position defined by [x,y] (version [1]) or by 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 latitude 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 CalcLatitude.

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): simplegeomap



Last Update: 2023-Dec-13