find_nearest
Find the nearest geographic features to a coordinate, sorted by distance. Use for proximity queries and reverse lookups to identify containing features and neighbors.
Instructions
Find the nearest counties, districts, ZIP codes, or other features to a coordinate. Use this for proximity queries, finding what's nearby, or ranking features by distance. Returns features sorted by distance (meters and miles), measured to feature boundary. Also works as a reverse lookup — returns the containing feature (distance=0) plus neighbors. Requires latitude, longitude, and a dataset id (UUID) from list_datasets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude in decimal degrees (WGS84) | |
| lng | Yes | Longitude in decimal degrees (WGS84) | |
| dataset | Yes | Dataset id (UUID) from list_datasets | |
| n | No | Number of nearest features to return (max 20, default 1) | |
| radius | No | Maximum search radius in meters (max 500000) |