Documentation
¶
Overview ¶
Package apicompute contains internal implementation for FeedsearchFilterToFeedIDs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FeedsearchFilterToFeedIDs ¶
func FeedsearchFilterToFeedIDs(m *apptypes.MobsqlRuntime, filter *FeedsearchFilter) ([]int, error)
FeedsearchFilterToFeedIDs translates the input search filter into an array of (Mobility Database and custom) feed ids.
This functionality is very helpful for quickly 'searching through' the Mobility Database for feed IDs which can be loaded and worked with via Mobsql.
Similar functionality is ofcourse available on the Mobility Database Website, however this functionality uses the local Mobility Database CSV and thus is ensured to be in-sync with the loaded GTFS feeds etc. As such, you may use this functionality to build out a 'feedsearch' functionality or similar in end-user applications.
Types ¶
type FeedsearchFilter ¶
type FeedsearchFilter struct { FeedID []int `json:"feed_id,omitempty"` // Any of mdbid match Country string `json:"country,omitempty"` // Country match Municipality string `json:"municipality,omitempty"` // Municipality match Subdivision string `json:"subdivision,omitempty"` // Subdivision match Provider string `json:"provider,omitempty"` // Provider match Name string `json:"name,omitempty"` // Name match Status string `json:"status,omitempty"` // Status match Glob string `json:"glob,omitempty"` // Glob match (Country, Municipality, Subdivision, Provider, Name, FeedID) Coords [][]float64 `json:"coords,omitempty"` // Coordinate match (expected at [lat,lon]) within bounding box MaxKM float64 `json:"maxkm,omitempty"` // Max kilometers match (e.g. bounding box must be smaller then) Loaded *bool `json:"loaded,omitempty"` // Loaded match (e.g. true/false or nil for both loaded & not loaded) Computed *bool `json:"computed,omitempty"` // Computed match (e.g. true/false or nil for both computed & not computed) }
FeedsearchFilter represents a 'filter' that ultimately acts as a search mechanism to determine feed IDs to use. This is a flexibly way of querying the MobilityDatabase's catalog for potential feed ids (MDBIDs) to use.