filter

package
v0.0.0-...-5283a38 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EQ is equivalent to = for int types or string equals
	EQ = "="
	// LT is equivalent to < for int types and noop for strings
	LT = "<"
	// GT is equivalent to > for int types and noop for strings
	GT = ">"
	// NOP means ignore the value and only check for matching name
	NOP = ""
)

Variables

This section is empty.

Functions

func Nodes

func Nodes(nodes []osm.Node, filter ConditionNode) []osm.Node

Nodes applies the given condition on all nodes and returns slice of nodes, satisfying the condition.

func Ways

func Ways(ways []osm.Way, filter ConditionWay) []osm.Way

Ways applies the given condition on all ways and returns slice of ways, satisfying the condition.

Types

type ConditionNode

type ConditionNode = func(node osm.Node) bool

ConditionNode defines a filter which is applied to each node during the filtering process.

type ConditionWay

type ConditionWay = func(way osm.Way) bool

ConditionWay defines a filter which is applied to each way during the filtering process.

type Filter

type Filter struct {
	Name     string
	Value    string
	ValueInt int
	Operand  Operand
}

Filter represents a single filter criteria for a tag.

func ToFilter

func ToFilter(filter string) ([]Filter, error)

ToFilter parses given string in slice of Filter commands. expected format of input string is: => a>4,b=6,c valid operators are: =,<,> and no operator

type Operand

type Operand string

Operand is a operator which is applied on a specific tag to check if the value of a tag has specific value.

Jump to

Keyboard shortcuts

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