Is there any a method that can get the closest point between a base point and a given set of target points. I can only found a restful-api but no documentation about using the c# sdk.
Here’s the link for the Spatial – Post Closest Point
Link: https://learn.microsoft.com/en-us/rest/api/maps/spatial/post-closest-point?view=rest-maps-2023-06-01&tabs=HTTP
I only found this documentation
Link: https://learn.microsoft.com/en-us/azure/azure-maps/how-to-dev-guide-csharp-sdk
sample snippet
// Use Azure Maps subscription key authentication
var subscriptionKey = Environment.GetEnvironmentVariable("SUBSCRIPTION_KEY") ?? string.Empty;
var credential = new AzureKeyCredential(subscriptionKey);
var client = new MapsSearchClient(credential);
SearchAddressResult searchResult = client.SearchAddress(
"1301 Alaskan Way, Seattle, WA 98101, US");
if (searchResult.Results.Count > 0)
{
SearchAddressResultItem result = searchResult.Results.First();
Console.WriteLine($"The Coordinate: ({result.Position.Latitude:F4}, {result.Position.Longitude:F4})");
}