grapes-eq-grapes: Binary operators used for building key-value pairs for...

Description Usage Arguments Details Examples

Description

These binary operators are used to query and filter oshex objects. They allow to apply grep-like textual queries (e.g. using %eq% or %inc%) and numerical queries (e.g. using %l%, %leq%, etc.) to tags and attributes. See 'Details' below for a description of each operator.

Usage

1
k %eq% v

Arguments

k

A key to query within an osh object.

v

A value to quey within an osh object.

Details

Each operator gets a key-value per as its left-right arguments respectively. %eq% and %inc% are used as equality operators, to condition a filter operation on an exact match or on a partial match (i.e. that a the word is included in the result), respectively.

%meq% and %leq% stand for more/less or equal and are capable to condition a filter operation based on the following numerical conditions: '>=', '<='. Similarly, %m% and %l% allow to condition filter operation based on the following numerical conditions: '>', '<'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# A condition to filter all objects that 
# have a 'landuse:highway' key-value pair

landuse %eq% highway

# A condition to filter all object that have a key equals to 
# addr:housenumber and values higher or equal to 30

addr:housenumber %meq% 30

# A condition to filter all objects that have a building key

building %eq% "."
building %inc% .

dof1985/OSHEX documentation built on May 28, 2019, 3:36 p.m.