esdata

package
v0.0.0-...-b8dbd7e Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexNameBus             = "bus"
	IndexNameBusStopPole     = "bus-stop-pole"
	IndexNameBusRoutePattern = "bus-route-pattern"
	IndexNamePassengerSurvey = "passenger-survey"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus struct {
	Date                        time.Time `json:"date"`
	Location                    Location  `json:"location"`
	Operator                    string    `json:"operator"`
	Route                       string    `json:"route"`
	Number                      string    `json:"busNumber"`
	StartingBusStopPole         string    `json:"startingPole"`
	StartingBusStopPoleLocation Location  `json:"startingPoleLocation"`
	TerminalBusStopPole         string    `json:"terminalPole"`
	TerminalBusStopPoleLocation Location  `json:"terminalPoleLocation"`
	FromBusStop                 string    `json:"fromStop"`
	FromBusStopLocation         Location  `json:"fromStopLocation"`
	FromBusStopTime             time.Time `json:"leftLastStopAt"`
	ToBusStop                   string    `json:"toStop,omitempty"`
	ToBusStopLocation           *Location `json:"toStopLocation,omitempty"`
	ProgressPercent             int       `json:"progressPercent"`
	SpeedKmPerHour              float32   `json:"speedKmPerHour"`
	FacingDegrees               float32   `json:"azimuth"`
	DoorStatus                  string    `json:"doorStatus"`
}

func FromODPTBus

func FromODPTBus(b []*odpt.Bus, poles odpt.BusStopPoleLookup) []*Bus

type BusRoutePattern

type BusRoutePattern struct {
	Date      time.Time `json:"date"`
	Title     string    `json:"title"`
	Kana      string    `json:"kana"`
	Operator  string    `json:"operator"`
	Route     string    `json:"route"`
	Pattern   string    `json:"pattern"`
	Location  *Location `json:"location,omitempty"`
	Next      *Location `json:"nextLocation,omitempty"`
	Direction string    `json:"direction"`
	SameAs    string    `json:"sameAs"`
}

func FromODPTBusRoutePattern

func FromODPTBusRoutePattern(bsr []*odpt.BusRoutePattern, poles odpt.BusStopPoleLookup) []*BusRoutePattern

type BusStopPole

type BusStopPole struct {
	Date     time.Time `json:"date"`
	Title    string    `json:"title"`
	Location Location  `json:"location"`
}

func FromODPTBusStopPole

func FromODPTBusStopPole(bsp []*odpt.BusStopPole) []*BusStopPole

type Importer

type Importer struct {
	// contains filtered or unexported fields
}

func NewImporter

func NewImporter(
	esClient *elasticsearch.Client,
	stationLookup odpt.StationLookup,
	busStopPoleLookup odpt.BusStopPoleLookup) *Importer

func (*Importer) DeleteAllDataIndices

func (i *Importer) DeleteAllDataIndices() error

func (*Importer) ImportBus

func (i *Importer) ImportBus(ctx context.Context, b []*odpt.Bus) error

func (*Importer) ImportBusRoutePattern

func (i *Importer) ImportBusRoutePattern(ctx context.Context, bsr []*odpt.BusRoutePattern) error

func (*Importer) ImportBusStopPole

func (i *Importer) ImportBusStopPole(ctx context.Context, bsp []*odpt.BusStopPole) error

func (*Importer) ImportPassengerSurvey

func (i *Importer) ImportPassengerSurvey(ctx context.Context, ps []*odpt.PassengerSurvey) error

type Location

type Location struct {
	Latitude  float64 `json:"lat"`
	Longitude float64 `json:"lon"`
}

func FromODPTLocation

func FromODPTLocation(loc odpt.Location) Location

type PassengerSurvey

type PassengerSurvey struct {
	Date             time.Time `json:"date"`
	IncludeAlighting bool      `json:"includeAlighting"`
	Operator         string    `json:"operator"`
	SurveyYear       int       `json:"surveyYear"`
	PassengersPerDay int       `json:"passengersPerDay"`
	Line             string    `json:"line"`
	Station          string    `json:"station"`
	Location         Location  `json:"location"`
}

func FromODPTPassengerSurvey

func FromODPTPassengerSurvey(ps []*odpt.PassengerSurvey, stations odpt.StationLookup) []*PassengerSurvey

Jump to

Keyboard shortcuts

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