Kovoschiz
(Kovoschiz)
8
["lanes"!~"^(<2)$"] has no effect. There’s no such regex syntax. It doesn’t do anything.
I would split them into different steps for clarity, and efficiency. This allows to easily combine different crtieria.
[out:json][timeout:25];
way({{bbox}})[highway][highway!=footway][highway!=cycleway][highway!=path][highway!=bridleway]->.all;
way.all["highway"~"^(motorway|trunk|primary|secondary|tertiary|unclassified|residential)$"][!lanes]->.check;
(
way.all[lanes](if: t["lanes"] >=2);
way.check[!"oneway"][!passing_places][junction!=roundabout][junction!=circular]; way.check["oneway"="no"][!passing_places];
way.check[highway=motorway][oneway=yes];
);
(._; - way._["surface"]["surface"!="^(unpaved|compacted|gravel|dirt|ground)$"]);
out geom;
There’s still the smaller problem of a pair of highway= + lanes=1 + oneway=yes roadways forming a two-way road, eg Way: 905500656 | OpenStreetMap section of CA-12 with delineators. This is a 2+1 road on the east, and =motorway= + lanes=1 in general are mostly hov=designated , resulting in them dropped, but with a parallel highway= next to them. Therefore it again depends on the format and attributes you require.
Ideally, the best method is to not filter directly. These should be combined in the preprocessing of the raw data for accuracy and simplicity.
2 Likes