dash.closest.latlon
Returns the latitude-longitude points closest to a set of coordinates
Syntax
Description
Searches through combinations of latitude and longitude points to find the values that are closest to specified latitude-longitude coordinates. This method is often used to locate the elements of a gridded dataset that are closest to a specific set of coordinates. Thus, the second and third inputs are usually the latitude and longitude metadata of a gridded dataset.
This function uses a haversine function to calculate the distance between sites. The haversine function is agnostic to longitude coordinate systems, so you may use longitudes on either -180:180 or 0:360, or even a mix of both coordinate systems.
Also returns the indices of the closest latitude and closest longitude points within the examined sets of points. These outputs can be used to index into the closest elements of a gridded dataset.