Plan a day-trip itinerary with realistic travel times
Когда использовать: You have 5 places you want to hit in one day and need a realistic order, with travel times.
Предварительные требования
- Google Maps API key with relevant APIs enabled — console.cloud.google.com → enable Geocoding, Places, Directions APIs, then create key
Поток
-
Geocode all stopsGeocode these 5 places into lat/lng: <list>. Verify each address looks right.✓ Скопировано→ 5 coordinates with confidence
-
Compute distance matrixGet drive times between every pair of stops at 10am on a weekday. Show as a matrix.✓ Скопировано→ 5×5 time matrix
-
Order and add directionsSuggest the order that minimizes total drive time. Then give me turn-by-turn directions stop-to-stop.✓ Скопировано→ Optimized route with directions
Итог: An itinerary you can actually execute, not 'sounds nice' planning.
Подводные камни
- Distance matrix doesn't account for parking time / walk to door — Pad each leg by 10-15 min for parking; longer for downtown destinations
- Real-time traffic only available for certain modes/regions — Use
departure_timeto get traffic-aware estimates; 'now' may be excluded depending on plan