Hello. I’d like to count popular street names in my part of world.
Street names are distinct in every city, and due to OSM data model one street name can be on multiple ways within city boundaries.
I was thinking about following approach:
Define area to query;
Download all admin_boundary=8 areas (cities) within area from step 1;
For each area from step 2 download all named streets there.
I’d be happy with output in csv format with columns city name and street name for all named streets and cities in area from step 1 as I can count them later in some other tool (perfect would be columns street_name and number of cities with such street.
you need to cycle through the ways you extract inside the foreach.
You can use the for statement breaking on name tag so to avoid displaying duplicates (assuming that a street is usually made up of several ways)
[out:csv(city, street)];
({{geocodeArea: powiat lubelski}};) -> .searchArea;
rel[admin_level=8](area.searchArea)->.cities;
foreach.cities (
map_to_area -> .city;
way[highway][name](area.city);
for (t["name"]){
make stat city=city.set(t["name"]),street=set(t["name"]);
out;
}
);
out body;
The small difference is probably just coincidence, and might be related to variations in server load. The issue with [out:csv] is that it doesn’t print any error messages (!), in particular you would never see a timeout error message.