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



GetClosestLongHighIx


Unit:SDL_geodb
Class:TGeoDB
Declaration:function GetClosestLongHighIx (Longit: double): longint;

In order to find database entries quickly TGeoDb maintains five indexes offering an ordered access to the latitudes, longitudes and item IDs of the database entries. Since a database entry may contain more than one point (e.g. country borders are polygons with many points), individual indexes are maintained both for the lowest and highest latitudes/longitudes.

The function GetClosestLongHighIx searches for an entry in the index of the highest longitudes (IxLongHigh) which is equal to Longit. If the index does not contain any entry matching exactly the specified longitude the closest value which is greater than Longit is selected. The function returns the element number of the index. The returned element number may take values between 1 and NumEntries+1. A value of NumEntries+1 indicates that there does not exist any value which is equal to or greater than Longit.

Hint: Please note that latitude/longitude values are stored as single precision floating point numbers. This may cause round-off errors when comparing the database and/or index values with the search parameter Longit.



Last Update: 2012-Oct-20