apifilter

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterToSourceset

func FilterToSourceset(m *apptypes.MobsqlRuntime, filter *SourcesetFilter) ([]int, error)

FilterToSourceset translates the input filter into an array of sourceset ids (e.g. in current implementation this is directly mdbids) by querying the internal view _vsources which is based on _mdb (which represents an import of the Mobility Database catalog).

Types

type SourcesetFilter

type SourcesetFilter struct {
	Mdbid        []int       `yaml:"mdbid,omitempty" json:"mdbid,omitempty"`               // Any of mdbid match
	Country      string      `yaml:"country,omitempty" json:"country,omitempty"`           // Country match
	Municipality string      `yaml:"municipality,omitempty" json:"municipality,omitempty"` // Municipality match
	Subdivision  string      `yaml:"subdivision,omitempty" json:"subdivision,omitempty"`   // Subdivision match
	Provider     string      `yaml:"provider,omitempty" json:"provider,omitempty"`         // Provider match
	Name         string      `yaml:"name,omitempty" json:"name,omitempty"`                 // Name match
	Status       string      `yaml:"status,omitempty" json:"status,omitempty"`             // Status match
	Glob         string      `yaml:"glob,omitempty" json:"glob,omitempty"`                 // Glob match (Country, Municipality, Subdivision, Provider, Name, Mdbid)
	Coords       [][]float64 `yaml:"coords,omitempty" json:"coords,omitempty"`             // Coordinate match (expected at [lat,lon]) within bounding box
	MaxKM        float64     `yaml:"maxkm,omitempty" json:"maxkm,omitempty"`               // Max kilometers match (e.g. bounding box must be smaller then)
	Loaded       *bool       `yaml:"loaded,omitempty" json:"loaded,omitempty"`             // Loaded match (e.g. true/false or nil for both loaded & not loaded)
	Computed     *bool       `yaml:"computed,omitempty" json:"computed,omitempty"`         // Computed match (e.g. true/false or nil for both computed & not computed)
}

SourcesetFilter represents a 'filter' that ultimately acts as a search mechanism to determine MDBIDs. This is a flexibly way of querying the MobilityDatabase's catalog for potential source MDBIDs (sourceset) to use.

Jump to

Keyboard shortcuts

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