Nearest Point
nearest_point_toolIdentifies the closest point in a collection to a target location, using efficient offline calculations to find the nearest store, stop, or landmark.
Instructions
Find the nearest point in a collection to a given target point. More efficient than calling distance_tool for each candidate and sorting. Useful for finding the closest store, stop, or landmark to a location. Works offline without API calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Distance units for the result | meters |
| points | Yes | Candidate points to search | |
| target | Yes | The reference point to measure from |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | Index of the nearest point in the input array | |
| units | Yes | Distance units | |
| nearest | Yes | The nearest point | |
| distance | Yes | Distance from target to nearest point |