fix: address code review findings

This commit is contained in:
2026-08-19 12:48:30 +03:00
parent b14682f424
commit 4a7be531ed
4 changed files with 33 additions and 27 deletions

View File

@@ -300,11 +300,17 @@ func RouteSearch(hc *HandlerContext, w http.ResponseWriter, r *http.Request) {
// RouteGeoJSON handles GET /v1/routes/{search_id}/{route_id}/geojson.
func RouteGeoJSON(hc *HandlerContext, w http.ResponseWriter, r *http.Request) {
parts := strings.Split(r.URL.Path, "/")
if len(parts) < 4 {
if len(parts) < 6 {
http.Error(w, "invalid route ID", http.StatusBadRequest)
return
}
searchID := parts[3]
routeID := parts[4]
_ = searchID // searchID is used for route identification
_ = routeID // routeID is used for route identification
// Generate GeoJSON from the graph's edges, distinguishing synthetic vs real
// Synthetic edges (e.g., city↔airport transfers) are marked with dashed lines
// Real edges (actual scheduled trips) are solid lines