This commit is contained in:
Arnaud Delcasse
2025-10-10 15:11:27 +02:00
parent 63fc3e7c83
commit a2c82a1a5c
6 changed files with 617 additions and 76 deletions

View File

@@ -24,19 +24,27 @@ type Itinerary struct {
// Leg represents a single segment of a journey
type Leg struct {
Mode string `json:"mode"` // WALK, BUS, TRAIN, etc.
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
Duration int `json:"duration"` // Duration in seconds
Distance float64 `json:"distance"` // Distance in meters
From Place `json:"from"`
To Place `json:"to"`
Route *Route `json:"route,omitempty"`
AgencyName string `json:"agencyName,omitempty"`
Headsign string `json:"headsign,omitempty"`
RouteShortName string `json:"routeShortName,omitempty"`
RouteColor string `json:"routeColor,omitempty"`
RouteTextColor string `json:"routeTextColor,omitempty"`
Mode string `json:"mode"` // WALK, BUS, TRAIN, etc.
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
Duration int `json:"duration"` // Duration in seconds
Distance float64 `json:"distance"` // Distance in meters
From Place `json:"from"`
To Place `json:"to"`
Route *Route `json:"route,omitempty"`
AgencyName string `json:"agencyName,omitempty"`
Headsign string `json:"headsign,omitempty"`
RouteShortName string `json:"routeShortName,omitempty"`
RouteColor string `json:"routeColor,omitempty"`
RouteTextColor string `json:"routeTextColor,omitempty"`
LegGeometry *LegGeometry `json:"legGeometry,omitempty"`
}
// LegGeometry represents the encoded polyline geometry of a leg
type LegGeometry struct {
Points string `json:"points"` // Encoded polyline string
Precision int `json:"precision"` // Polyline precision (7 for v1, 6 for v2)
Length int `json:"length"` // Number of points in the polyline
}
// Place represents a location (stop, station, or coordinate)