You are not logged in.

#1 2019-10-29 22:22:18

Nguyenhuy1607
New Member
Registered: 2019-10-29
Posts: 1

How to get all street names of city

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

Offline

#2 2019-10-30 03:12:48

luisforte
Member
Registered: 2017-09-03
Posts: 7

Re: 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.

Last edited by luisforte (2019-10-30 12:54:38)

Offline

#3 2021-09-13 12:40:54

augustofagioli
New Member
Registered: 2021-09-13
Posts: 1

Re: How to get all street names of city

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

Offline

#4 2021-09-15 15:08:46

luisforte
Member
Registered: 2017-09-03
Posts: 7

Re: How to get all street names of city

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.

Offline

#5 2021-09-15 17:06:48

Marek-M
Member
From: [PL] Banino
Registered: 2017-01-24
Posts: 235

Re: How to get all street names of city

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.


Marek-M

Offline

#6 2021-09-18 16:41:43

niceboshka
Member
Registered: 2021-09-18
Posts: 3

Re: How to get all street names of city

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

Offline

#7 2021-09-18 19:30:03

Marek-M
Member
From: [PL] Banino
Registered: 2017-01-24
Posts: 235

Re: How to get all street names of city

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?

Last edited by Marek-M (2021-09-18 19:34:23)


Marek-M

Offline

#8 2021-09-18 21:42:05

niceboshka
Member
Registered: 2021-09-18
Posts: 3

Re: How to get all street names of city

way 297727234

Offline

#9 2021-09-18 21:56:43

niceboshka
Member
Registered: 2021-09-18
Posts: 3

Re: How to get all street names of city

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);

Offline

#10 2021-09-18 22:39:53

Marek-M
Member
From: [PL] Banino
Registered: 2017-01-24
Posts: 235

Re: How to get all street names of city

niceboshka wrote:

way 297727234

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.


Marek-M

Offline

#11 2021-09-19 10:44:08

Marek-M
Member
From: [PL] Banino
Registered: 2017-01-24
Posts: 235

Re: How to get all street names of city

Here is search result on image:
F84IrE9.png


Marek-M

Offline

Board footer

Powered by FluxBB