Hello,
I would like to find the same house numbers that are closer than 150 meters via Oparpass Turbo. How to build this? Thanks!
Please post the code you already have.
Remember they may not be wrong. It depends on your community’s method.
[timeout:55][out:json];
nwr({{bbox}})["addr:housenumber"]["addr:street"]->.all;
for.all->.thisst(t["addr:street"])
{
nwr.all(if: t["addr:street"]==thisst.val)->.onthisst;
for.onthisst->.thisnum(t["addr:housenumber"])
{
nwr.onthisst(if: t["addr:housenumber"]==thisnum.val)->.matches;
if (matches.count(nwr) >= 2)
{
foreach.matches->.thismatch
{
nwr.matches(around.thismatch:150)->.nearthismatch;
if (nearthismatch.count(nwr) >= 2)
{
(.nearthismatch; - .results;);
out geom;
(.nearthismatch; .results;)->.results;
};
};
};
};
};
In the final process, imagine a situation where 3 addresses are 100m away from each other on a straight line. You need to run around:
on all of them to get all results. Can only remove redundant results when outputting. Can’t discard the middle one immediately, as it will cause the last one to be excluded.