Puntos más cercanos
geo-nearestOrdena puntos candidatos por distancia desde un origen y devuelve los k más cercanos. Cuándo: hay que calcular coordenadas, distancias, rumbos o áreas a partir de puntos dados. No para: calcular la distancia ortodrómica entre dos puntos (geo-haversine). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Ranks up to 10,000 candidate points by great-circle distance from an origin and returns the k nearest with their distances and original indices. When: coordinates, distances, bearings or areas have to be computed from given points. Not for: computing the great-circle distance between two lat/lon points on a spherical Earth (geo-haversine). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | How many (integer; optional; default 3; min 1; max 1000). | |
| unit | No | Distance unit (optional; one of: m, km, mi, nmi, ft; default "km"). | km |
| origin | Yes | Point as {lat, lon} in decimal degrees (WGS84) (object; required). | |
| candidates | Yes | Candidates; extra fields like id/name are returned (array of object; required; at least 1 items). | |
| max_distance | No | Ignore farther than this (number; optional; > 0). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | ||
| results | No |