How to get all street names of city

Hi all,
Please share for me, How to get all street names of city

The most usual tool to extract data from OSM is by using Overpass (https://overpass-turbo.eu/).
A simple way to get all street names from a place, “Brinches” in the example bellow, consists of a query to the database with something like


[out:csv(highway,name)];
area
  [name="Brinches"];
way(area)[highway][name];
out;

Just copy and paste this code to the text area on the left side of the Overpass page, change the name of the place to the place you pretend to evaluate, run the query and select the folder “Data” on the upper right side of the page to see the results.

1 Like

Cool feature.
When asking for Rome (Italy), a “quota limit” comes out.
What to do?

I ran the query now for area[name=“Roma”], it seems to works fine on my computer, I got more than 40,000 street names.
Perhaps the server was busy with other requests at the time you tried to run the query.
But keep in mind that I haven’t found any city limits with that name (“Roma”), only the district is named “Roma”, so you’ll probably get more information than you want, like suburban streets or neighboring villages.

Try to use this query in overpass:


[out:csv ("name")][timeout:2500];
{{geocodeArea:Roma}}->.searchArea;
(
  way["highway"]["name"](area.searchArea);
);
for (t["name"])
{
  make street name=_.val;
  out;
}

https://overpass-turbo.eu/s/1bcc
This query extracts street names list from area without duplicates. This query returns 16715 records for Roma instead of 40000.

I do

[out:csv ("name")][timeout:2500];
{{geocodeArea:Kaliningrad}}->.searchArea;
(
  way["highway"]["name"](area.searchArea);
);
for (t["name"])
{
  make street name=_.val;
  out;
}

I did not receive the entire list, for example there is no Moscow avenue

Is there a street with this name in Kaliningrad? I can’t find it on Opensteetmap. Could you send way ID of this street in OSM?

way 297727234

It’s kind of the only street left, because now my list is longer than it was. Thanks for the sample code. I wonder if it is possible to compose a query to get the streets and their geometries? Because now it’s like this
I have an array of streets

$response = json_decode(curl('https://nominatim.openstreetmap.org/search?format=json&q=' . urlencode($f['city'] . ', ' . $f['street']) . '&polygon_geojson=1'), true);

Using your query for Kaliningrad I did found ‘Московский проспект’ on street names list. You should try again. Copy whole list and paste content to notepad, than use find function.

Here is search result on image:

Hello,
I am building an app where I should display all the street names in a drop down when the user selects a city.
Is there a way to include the overpass Api in my code?
I am using javascript.

Thanks

Hi,

@

Is there a way to add a column representing the city name and another with the postal code?

Thank you

Hi, is it posible to obtain in the same file the ID of the street?

Are you aware that one street in real life CAN exist in the OSM database by a chain of many single way elements?

So you want to have the OSM object ID number of a single element, or of all elements of a street?

[out:csv (“name”)][timeout:2500];
{{geocodeArea:Roma}}->.searchArea;
(
way[“highway”]“name”;
);
for (t[“name”])
{
make street name=_.val;
out;

1 Like

How to get all street names of city in italy based the zip code?
tks