formatterlegs

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLegs

func FormatLegs(
	connectionsVerbose *[]dbt.ConnectionVerbose,
	transfers *[]dbt.Transfer,
	beginTime *time.Time,
	walkspeedKmHr float64,
	from utilfuncs.Coord,
	to utilfuncs.Coord,
) *[]RouteLeg

Types

type RouteLeg

type RouteLeg struct {
	LegType       string    `json:"leg_type"` // transfer, walk, or trip
	LegBeginTime  time.Time `json:"leg_begin_time,omitempty"`
	LegEndTime    time.Time `json:"leg_end_time,omitempty"`
	LegDuration   string    `json:"leg_duration"`
	LegFromCoords string    `json:"leg_from_coords"`
	LegToCoords   string    `json:"leg_to_coords"`

	// When LegType == "trip" will be present
	TripRoute         *string         `json:"trip_route,omitempty"`
	TripRouteHeadsign *string         `json:"trip_route_headsign,omitempty"`
	TripFrom          *string         `json:"trip_from,omitempty"`
	TripFromSIDU      *string         `json:"-"`
	TripToSIDU        *string         `json:"-"`
	TripTo            *string         `json:"trip_to,omitempty"`
	TripStops         *[]*StopDetails `json:"trip_stops,omitempty"`
	TripSource        *int            `json:"trip_source,omitempty"`
	TripAgencyID      *string         `json:"trip_agency_id,omitempty"`

	// When LegType == "walk" wil be present
	TransferFrom     *string `json:"transfer_from,omitempty"`
	TransferTo       *string `json:"transfer_to,omitempty"`
	TransferDdwell   *string `json:"transfer_ddwell,omitempty"`
	TransferDactive  *string `json:"transfer_dactive,omitempty"`
	TransferCategory *string `json:"transfer_category,omitempty"`
	TransferSources  *[]int  `json:"transfer_sources,omitempty"`

	// When LegType == "transfer" will be present
	WalkTo     *string  `json:"walk_to,omitempty"`
	WalkFrom   *string  `json:"walk_from,omitempty"`
	WalkDistKm *float64 `json:"walk_dist_km,omitempty"`
}

func FormatConnectionsToLegTransfer added in v0.5.0

func FormatConnectionsToLegTransfer(
	transfers *[]dbt.Transfer,
	legTransferFrom, legTransferTo *RouteLeg,
) *RouteLeg

func FormatConnectionsToLegTrip added in v0.5.0

func FormatConnectionsToLegTrip(
	yyyymmdd uint,
	timezoneUTCDeltasecs int,
	legConnections []*dbt.ConnectionVerbose,
) *RouteLeg

func FormatLegWalk added in v0.5.0

func FormatLegWalk(
	coordFrom, coordTo utilfuncs.Coord,
	labelFrom, labelTo string,
	beginWalkAtTime time.Time,
	walkspeedKmHr float64,
) *RouteLeg

type StopDetails

type StopDetails struct {
	Time   time.Time `json:"stop_time"`
	Name   string    `json:"stop_name"`
	Coords string    `json:"stop_coords"`
	ConnID string    `json:"stop_conn_id"`
}

func FormatLegsStopDetails added in v0.5.0

func FormatLegsStopDetails(
	yyyymmdd uint,
	timezoneUTCDeltasecs int,
	legConnections []*dbt.ConnectionVerbose,
) []*StopDetails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL