Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple id query (id: ) #358

Merged
merged 3 commits into from
Apr 5, 2017
Merged

Conversation

mmd-osm
Copy link
Contributor

@mmd-osm mmd-osm commented Jan 2, 2017

After extending (user: ) and (uid: ) to multiple entries, we apply the same logic to the item query for a faster, more compact query. Due to possible conflicts with a bbox filter, an additional prefix (id: is introduced in this patch. The single value variant rel(1234) is left untouched, of course.

Currently used approaches as seen in the wild:

  1. Union statement:
[out:csv(::id)];
(rel(341906);rel(356889);rel(356892);rel(356911);rel(356912); ... );
  1. Build inputset step by step
[out:csv(::id)];(.a;rel(341906);)->.a;(.a;rel(356889);)->.a;(.a;rel(356892);)->.a;
(.a;rel(356911);)->.a;(.a;rel(356912);)->.a;(.a;rel(356943);)->.a;(.a;rel(356958);)->.a;
(.a;rel(356959);)->.a;(.a;rel(356992);)->.a;(.a;rel(357112);)->.a;(.a;rel(357113);)->.a;
(.a;rel(357245);)->.a;(.a;rel(357246);)->.a;(.a;rel(357247);)->.a;(.a;rel(357773);)->.a;
(.a;rel(357785);)->.a;(.a;rel(357786);)->.a;(.a;rel(357787);)->.a;(.a;rel(357789);)->.a;
(.a;rel(357794);)->.a;(.a;rel(357795);)->.a;(.a;rel(357798);)->.a;(.a;rel(357800);)->.a;
(.a;rel(357805);)->.a;(.a;rel(357815);)->.a;(.a;rel(357816);)->.a;

Streamlined (id: ) filter:

Link to test case: http://overpass-turbo.eu/s/kYk

[out:csv(::id)];
rel(id:341906,356889,356892,356911,356912,356943,356958,
356959,356992,357112,357113,357245,357246,357247,357773,357785,
357786,357787,357789,357794,357795,357798,357800,357805,357815,
357816,357817,357839,357840,357872,357873,357884,357885,358571,
358572,358573,358574,358575,358576,358594,358601,358602,358609,
358613,358621,358622,358623,358624,358625,358626,358627,358631,
358647,358651,358662,358663,358672,358673,358674,358675,358676,
358678,358679,358680,358681,358682,358683,358684,358685,358686,
358690,358691,358692,358693,358694,358695,358696,358707,358708,
358709,358710,358711,358722,358727,358733,358734,358735,358736,
358737,358742,358743,358744,358752,358753,358754,358755,358759,
358760,358761,358766,358767,358768,358769,358774,358775,358776,
358778,358779,358785,358786,358789,358790,358794,358795,359195,
359218,359219,359220,359221,359250,359251,359252,359253,359259,
359260,382313,532759,722196,722197,722198,722201,722202,722220);
rel._(changed:"2016-12-18T23:00:54.219200Z");out ids;

@drolbr
Copy link
Owner

drolbr commented Apr 5, 2017

Thank you for the patch. There are some minor coding issues, i.e. unecessary post-increment. I'll address that in a subsequent commit.

@drolbr drolbr closed this Apr 5, 2017
@drolbr drolbr reopened this Apr 5, 2017
@drolbr drolbr merged commit cd594e0 into drolbr:master Apr 5, 2017
@mmd-osm mmd-osm deleted the feature/multiple_id branch April 5, 2017 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants