dash.closest.site
Returns the coordinates of sites closest to a set of coordinates
Syntax
Description
Searches through latitude-longitude points to find the points that are closest to a set of latitude-longitude coordinates. The first input is the set of coordinates for which to find the closest points. The second input lists the set of available latitude-longitude coordinates. This method is often used to locate the elements of a non-spatially gridded dataset that are closest to a specific set of coordinates.
This function uses a haversine function to calculate the distance between sites. Since the haversine function is agnostic to longitude coordinate systems, you may use longitudes on -180:180, 0:360, or even a mix of both coordinate systems.
[coordinates, siteIndices] = dash.closest.site(…)
Also returns the index of the closest site within the set of examined points. These indices can be used to index into the closest element