goplaces/docs/route.md
2026-01-02 22:38:59 +01:00

750 B

Route Search

Route search samples waypoints along a route and runs a text search at each waypoint.

CLI

goplaces route "coffee" --from "Seattle, WA" --to "Portland, OR" --max-waypoints 5

Options:

  • --mode travel mode: DRIVE, WALK, BICYCLE, TWO_WHEELER, TRANSIT.
  • --radius-m search radius per waypoint.
  • --limit results per waypoint.

Library

response, err := client.Route(ctx, goplaces.RouteRequest{
    Query:        "coffee",
    From:         "Seattle, WA",
    To:           "Portland, OR",
    Mode:         "DRIVE",
    RadiusM:      1000,
    MaxWaypoints: 5,
    Limit:        5,
})

Notes

  • Requires the Google Routes API to be enabled.
  • Waypoints are sampled evenly along the route polyline.