Subject: Overpass API developpement
- From: Roland Olbricht <>
- Subject: Re: [overpass] Date ranges with Overpass API
- Date: Wed, 11 Jan 2017 20:09:51 +0100
Although late, I would like to provide the promised follow-up.
First of all, thank you to all who have given feedback. The evaluator _is_num_ is now renamed to _is_number_ to be in line with _number_ and _date_ and _is_date_.
A still open point is the syntax for tag evaulation.
or so would make to tag evaulator more intuitively. I would like to stick with the brackets, because people know that as syntax of dictionaries. And the tags of an element constitute a dictionary.
That there is close-call syntax with a different meaning in the XAPI legacy is admittedly a pity. But we should not throw out that syntax just for the sake of purity, not now and not next year. Giving people a migration path to the more versatile present and future syntax is more important.
But now the promised further examples:
The filter for date ranges is actually a full fledged less than, and variants for less-equal, greater-than and greater-equal exist as well:
Find fast roads:
Look for roads with non-number values:
Or objects that have only a name tag:
Beside this, one can find all objects with similar (or related) properties:
Enhanced version, this one also gets nodes with level:
Even more, we could get one level up:
Beside filter, the make statement allows to create objects as desired.
The simplest case is to output where useful a marker:
This also contains a generalisation of the count.
You could list all values of a tag that exist in a result in addition to counting:
The full list of aggregators, like _set_ and _count_ used here, can be found in the specification (TODO).
This version also brings a possibility to rewrite tags lists of objects.
If you do want objects with lots of tags in the result but only need some tags
then you can use an approach like this:
This has already been possible with the special output mode [out:csv].
But now you can feed this into your toolchain regardless whether you need XML or JSON as well.
Or just combine names:
In some cases, you only want to knock out one or two tags:
Finally, this allows to generate is_in-tags on the fly:
( convert node ::=::,is_in=a.set([name]); .result; )->.result;
(note: currently no areas on the dev instance, hence no link)
Although it is not fast, it generalizes to other relationships:
- Re: [overpass] Date ranges with Overpass API, Roland Olbricht, 01/11/2017
Archive powered by MHonArc 2.6.18.