overpass-turbo icon indicating copy to clipboard operation
overpass-turbo copied to clipboard

New operators for wizard: not, older:, meta

Open RicoElectrico opened this issue 8 years ago • 2 comments

or could be very useful because currently one can't negate a whole expression in parenthesis, older: as a counterpart to newer:, and meta(setting out meta in the resultant query) for edit review, as I do for my local area.

RicoElectrico avatar Jun 09 '16 11:06 RicoElectrico

My usecase for older - I am trying to simplify query that detects highway=construction that were not modified in a long time among one of filters (as part of https://github.com/westnordost/StreetComplete/pull/920 ).

http://overpass-turbo.eu/s/wVx attempt failed as while way[highway=construction](newer: '2017-06-16T00:00:00Z') works, there is no simple way to apply an an opposite filter.

matkoniecz avatar Mar 12 '18 13:03 matkoniecz

In the forthcoming release 0.7.55 you can express older by using the timestamp() function:

[date:"2017-06-30T00:00:00Z"]
[bbox:47.80952,12.0973,47.81005,12.09801];

way[highway=construction][!fixme]
    (if: timestamp() <= date('2016-06-16T00:00:00Z') &&
        (!is_date(t['opening_date']) || 
          date(t['opening_date']) < date('2017-06-16T00:00:00Z')));
out meta geom;

mmd-osm avatar Mar 31 '18 09:03 mmd-osm