Repository navigation
Conversation
Author
|
The initial PR description had an error when describing The equivalence of Thanks to @mmd-osm who very speedily noted this in drolbr#810 (comment). |
…ters In a query statement, wr(bn.s) is a Recurse_Constraint of type RECURSE_NODE_WR, which none of the constraint's methods handled: get_way_ranges and get_relation_ranges returned global ranges, get_data collected nothing, and filter dropped all ways and kept attic relations unfiltered. So wr(bn.s) with a tag filter fell back to the tag filter over the whole database: it returned nothing or failed with "Filters too weak" at the current date, and returned unrelated relations at a past date. Handle RECURSE_NODE_WR in these methods as RECURSE_NODE_WAY for ways and RECURSE_NODE_RELATION for relations, as the standalone wr(bn.s) statement does. The regression tests regression_wr_bn_tag_filter and regression_wr_bn_tag_filter_date cover the current and past-date cases. On a Nova Scotia extract: [out:csv(::count)]; node(44.6470,-63.5760,44.6490,-63.5730)->.s; wr(bn.s)["highway"]; out count; returned 0 ways in 0.53 s, and now returns 141 in 0.01 s, the same as (way(bn.s)["highway"]; rel(bn.s)["highway"];). Co-Authored-By: Colin Dellow <cldellow@gmail.com>
cldellow
force-pushed
the
recurse-node-wr-ranges
branch
from
December 1, 2026 01:22
3ee5733 to
3bfdade
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes drolbr#810
Overpass queries are a statement that generates the initial set of results plus some number of constraints that further refine them.
wr(bn)is aRecurse_Statement, and returns correct results.wr(bn)[highway]is aQuery_Statementwith aRecurse_Constraintand returns incorrect results.Conveniently, Overpass itself provides two ways to exercise this bug:
wr(bn.n)[highway]must be equal to(way(bn.n)[highway]; rel(bn.n)[highway];)(and theway(bn.n)[highway]andrel(bn.n)[highway]forms don't have this bug)wr(bn)must be equal towr(bn)(if:1)(and the latter form forces theQuery_Statement+Recurse_Constraintbehaviour)The constraint mode didn't correctly filter data, so wr(bn.s) with a tag filter fell back to the tag filter over the whole database: it returned nothing or failed with "Filters too weak" at the current date, and returned unrelated relations at a past date.
The fix is to apply the same filters as the statement version does.
On a Nova Scotia extract:
returned 0 ways in 0.53 s, and now returns 141 in 0.01 s, the same as (way(bn.s)["highway"]; rel(bn.s)["highway"];).