1

Need an overpass-turbo query to highlight on a map [highways] in a certain city with a certain number of nodes. Tried something like

[out:json];
area[name="New York City"]->.ny;
way(area.ny)[highway];
foreach (
  way._(if:count(nodes) == 50);
  out geom;
);

but it returned an empty set.

1 Answer 1

0

It took me some time to dig through the documentation but the key to solve your question is the count_members() evaluator. I've changed your query to the following:

[out:json];
area[name="New York"]->.ny;
way(area.ny)["highway"];
foreach (
  way._(if:count_members() == 50);
  out geom;
);

Instead of the count(nodes) evaluator (which will count the nodes in the set and you have only ways in it) you need to count the members of the ways which you can correctly compare then. Here is my result:

The result of the above query.

And here is some more detailed view to show that the ways are added correctly and not only seen as circles:

More detailed view to see the ways correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.