## Snap a coordinate to the nearest road **get** `/api/v1/nearest` Snap a coordinate to the nearest road ### Query Parameters - `lat: number` Latitude - `lng: number` Longitude - `radius: optional number` Search radius in meters (default 500, max 5000) ### Returns - `NearestResult = object { geometry, properties, type }` GeoJSON Point Feature snapped to the nearest road segment - `geometry: GeoJsonGeometry` - `coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number` GeoJSON coordinates array (nesting depth varies by geometry type) - `array of number` - `array of array of number` - `array of array of array of number` - `array of array of array of array of number` - `type: "Point" or "LineString" or "Polygon" or 3 more` - `"Point"` - `"LineString"` - `"Polygon"` - `"MultiPoint"` - `"MultiLineString"` - `"MultiPolygon"` - `properties: object { distance_m, edge_id }` - `distance_m: optional number` Distance to nearest road in meters - `edge_id: optional number` Road edge ID - `type: "Feature"` - `"Feature"` ### Example ```http curl https://plaza.fyi/api/v1/nearest \ -H "Authorization: Bearer $PLAZA_API_KEY" ``` #### Response ```json { "geometry": { "coordinates": [ 0 ], "type": "Point" }, "properties": { "distance_m": 0, "edge_id": 0 }, "type": "Feature" } ```